Add a WebViewDidMoveToWindowObserver for WKWebView
[WebKit-https.git] / Source / WebKit / CMakeLists.txt
1 include(WebKitCommon)
2
3 set_property(DIRECTORY . PROPERTY FOLDER "WebKit")
4
5 set(WebKit_INCLUDE_DIRECTORIES
6     "${WEBKIT_DIR}"
7     "${WEBKIT_DIR}/NetworkProcess"
8     "${WEBKIT_DIR}/NetworkProcess/Classifier"
9     "${WEBKIT_DIR}/NetworkProcess/Cookies"
10     "${WEBKIT_DIR}/NetworkProcess/CustomProtocols"
11     "${WEBKIT_DIR}/NetworkProcess/Downloads"
12     "${WEBKIT_DIR}/NetworkProcess/FileAPI"
13     "${WEBKIT_DIR}/NetworkProcess/IndexedDB"
14     "${WEBKIT_DIR}/NetworkProcess/ServiceWorker"
15     "${WEBKIT_DIR}/NetworkProcess/cache"
16     "${WEBKIT_DIR}/NetworkProcess/watchos"
17     "${WEBKIT_DIR}/NetworkProcess/webrtc"
18     "${WEBKIT_DIR}/Platform"
19     "${WEBKIT_DIR}/Platform/IPC"
20     "${WEBKIT_DIR}/PluginProcess"
21     "${WEBKIT_DIR}/Shared"
22     "${WEBKIT_DIR}/Shared/API"
23     "${WEBKIT_DIR}/Shared/API/c"
24     "${WEBKIT_DIR}/Shared/Authentication"
25     "${WEBKIT_DIR}/Shared/CoreIPCSupport"
26     "${WEBKIT_DIR}/Shared/Databases"
27     "${WEBKIT_DIR}/Shared/Databases/IndexedDB"
28     "${WEBKIT_DIR}/Shared/FileAPI"
29     "${WEBKIT_DIR}/Shared/Gamepad"
30     "${WEBKIT_DIR}/Shared/Plugins"
31     "${WEBKIT_DIR}/Shared/Plugins/Netscape"
32     "${WEBKIT_DIR}/Shared/Plugins/Netscape/x11"
33     "${WEBKIT_DIR}/Shared/RemoteLayerTree"
34     "${WEBKIT_DIR}/Shared/WebsiteData"
35     "${WEBKIT_DIR}/UIProcess"
36     "${WEBKIT_DIR}/UIProcess/API"
37     "${WEBKIT_DIR}/UIProcess/API/C"
38     "${WEBKIT_DIR}/UIProcess/API/cpp"
39     "${WEBKIT_DIR}/UIProcess/ApplePay"
40     "${WEBKIT_DIR}/UIProcess/Authentication"
41     "${WEBKIT_DIR}/UIProcess/Automation"
42     "${WEBKIT_DIR}/UIProcess/Downloads"
43     "${WEBKIT_DIR}/UIProcess/Gamepad"
44     "${WEBKIT_DIR}/UIProcess/Launcher"
45     "${WEBKIT_DIR}/UIProcess/Network"
46     "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols"
47     "${WEBKIT_DIR}/UIProcess/Notifications"
48     "${WEBKIT_DIR}/UIProcess/Plugins"
49     "${WEBKIT_DIR}/UIProcess/RemoteLayerTree"
50     "${WEBKIT_DIR}/UIProcess/UserContent"
51     "${WEBKIT_DIR}/UIProcess/WebAuthentication"
52     "${WEBKIT_DIR}/UIProcess/WebAuthentication/Mock"
53     "${WEBKIT_DIR}/UIProcess/WebStorage"
54     "${WEBKIT_DIR}/UIProcess/WebsiteData"
55     "${WEBKIT_DIR}/WebProcess"
56     "${WEBKIT_DIR}/WebProcess/ApplePay"
57     "${WEBKIT_DIR}/WebProcess/ApplicationCache"
58     "${WEBKIT_DIR}/WebProcess/Automation"
59     "${WEBKIT_DIR}/WebProcess/Cache"
60     "${WEBKIT_DIR}/WebProcess/Databases"
61     "${WEBKIT_DIR}/WebProcess/Databases/IndexedDB"
62     "${WEBKIT_DIR}/WebProcess/FileAPI"
63     "${WEBKIT_DIR}/WebProcess/FullScreen"
64     "${WEBKIT_DIR}/WebProcess/Gamepad"
65     "${WEBKIT_DIR}/WebProcess/Geolocation"
66     "${WEBKIT_DIR}/WebProcess/IconDatabase"
67     "${WEBKIT_DIR}/WebProcess/InjectedBundle"
68     "${WEBKIT_DIR}/WebProcess/InjectedBundle/API"
69     "${WEBKIT_DIR}/WebProcess/InjectedBundle/API/c"
70     "${WEBKIT_DIR}/WebProcess/InjectedBundle/DOM"
71     "${WEBKIT_DIR}/WebProcess/Launching"
72     "${WEBKIT_DIR}/WebProcess/MediaCache"
73     "${WEBKIT_DIR}/WebProcess/MediaStream"
74     "${WEBKIT_DIR}/WebProcess/Network"
75     "${WEBKIT_DIR}/WebProcess/Network/webrtc"
76     "${WEBKIT_DIR}/WebProcess/Notifications"
77     "${WEBKIT_DIR}/WebProcess/OriginData"
78     "${WEBKIT_DIR}/WebProcess/Plugins"
79     "${WEBKIT_DIR}/WebProcess/Plugins/Netscape"
80     "${WEBKIT_DIR}/WebProcess/ResourceCache"
81     "${WEBKIT_DIR}/WebProcess/Storage"
82     "${WEBKIT_DIR}/WebProcess/UserContent"
83     "${WEBKIT_DIR}/WebProcess/WebCoreSupport"
84     "${WEBKIT_DIR}/WebProcess/WebPage"
85     "${WEBKIT_DIR}/WebProcess/WebPage/RemoteLayerTree"
86     "${WEBKIT_DIR}/WebProcess/WebStorage"
87     "${DERIVED_SOURCES_WEBKIT_DIR}"
88     "${DERIVED_SOURCES_WEBKIT_DIR}/include"
89     "${CMAKE_SOURCE_DIR}/Source"
90     "${CMAKE_SOURCE_DIR}/WebKitLibraries"
91 )
92
93 set(PROTOCOL_GENERATOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
94
95 set(WebKit_SYSTEM_INCLUDE_DIRECTORIES
96     ${ICU_INCLUDE_DIRS}
97 )
98
99 list(APPEND WebKit_UNIFIED_SOURCE_LIST_FILES
100     "Sources.txt"
101 )
102
103 set(WebKit_MESSAGES_IN_FILES
104     NetworkProcess/Cookies/WebCookieManager.messages.in
105
106     NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in
107
108     NetworkProcess/NetworkConnectionToWebProcess.messages.in
109     NetworkProcess/NetworkContentRuleListManager.messages.in
110     NetworkProcess/NetworkProcess.messages.in
111     NetworkProcess/NetworkResourceLoader.messages.in
112     NetworkProcess/NetworkSocketStream.messages.in
113
114     NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in
115     NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in
116
117     NetworkProcess/cache/CacheStorageEngineConnection.messages.in
118
119     NetworkProcess/webrtc/NetworkMDNSRegister.messages.in
120     NetworkProcess/webrtc/NetworkRTCMonitor.messages.in
121     NetworkProcess/webrtc/NetworkRTCProvider.messages.in
122     NetworkProcess/webrtc/NetworkRTCSocket.messages.in
123
124     PluginProcess/PluginControllerProxy.messages.in
125     PluginProcess/PluginProcess.messages.in
126     PluginProcess/WebProcessConnection.messages.in
127
128     Shared/AuxiliaryProcess.messages.in
129     Shared/WebConnection.messages.in
130
131     Shared/Authentication/AuthenticationManager.messages.in
132
133     Shared/Plugins/NPObjectMessageReceiver.messages.in
134
135     UIProcess/DrawingAreaProxy.messages.in
136     UIProcess/RemoteWebInspectorProxy.messages.in
137     UIProcess/VisitedLinkStore.messages.in
138     UIProcess/WebCookieManagerProxy.messages.in
139     UIProcess/WebFullScreenManagerProxy.messages.in
140     UIProcess/WebGeolocationManagerProxy.messages.in
141     UIProcess/WebInspectorProxy.messages.in
142     UIProcess/WebPageProxy.messages.in
143     UIProcess/WebPasteboardProxy.messages.in
144     UIProcess/WebProcessPool.messages.in
145     UIProcess/WebProcessProxy.messages.in
146     UIProcess/WebResourceLoadStatisticsStore.messages.in
147
148     UIProcess/Automation/WebAutomationSession.messages.in
149
150     UIProcess/Downloads/DownloadProxy.messages.in
151
152     UIProcess/Network/NetworkProcessProxy.messages.in
153
154     UIProcess/Plugins/PluginProcessProxy.messages.in
155
156     UIProcess/UserContent/WebUserContentControllerProxy.messages.in
157
158     UIProcess/WebStorage/StorageManager.messages.in
159
160     WebProcess/WebProcess.messages.in
161
162     WebProcess/Automation/WebAutomationSessionProxy.messages.in
163
164     WebProcess/Cache/WebCacheStorageConnection.messages.in
165
166     WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in
167
168     WebProcess/FullScreen/WebFullScreenManager.messages.in
169
170     WebProcess/Geolocation/WebGeolocationManager.messages.in
171
172     WebProcess/Network/webrtc/WebMDNSRegister.messages.in
173     WebProcess/Network/webrtc/WebRTCMonitor.messages.in
174     WebProcess/Network/webrtc/WebRTCResolver.messages.in
175     WebProcess/Network/webrtc/WebRTCSocket.messages.in
176
177     WebProcess/Network/NetworkProcessConnection.messages.in
178     WebProcess/Network/WebResourceLoader.messages.in
179     WebProcess/Network/WebSocketStream.messages.in
180
181     WebProcess/Notifications/WebNotificationManager.messages.in
182
183     WebProcess/Plugins/PluginProcessConnection.messages.in
184     WebProcess/Plugins/PluginProcessConnectionManager.messages.in
185     WebProcess/Plugins/PluginProxy.messages.in
186
187     WebProcess/Storage/ServiceWorkerClientFetch.messages.in
188     WebProcess/Storage/WebSWClientConnection.messages.in
189     WebProcess/Storage/WebSWContextManagerConnection.messages.in
190
191     WebProcess/UserContent/WebUserContentController.messages.in
192
193     WebProcess/WebPage/DrawingArea.messages.in
194     WebProcess/WebPage/EventDispatcher.messages.in
195     WebProcess/WebPage/RemoteWebInspectorUI.messages.in
196     WebProcess/WebPage/VisitedLinkTableController.messages.in
197     WebProcess/WebPage/WebInspector.messages.in
198     WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in
199     WebProcess/WebPage/WebInspectorUI.messages.in
200     WebProcess/WebPage/WebPage.messages.in
201
202     WebProcess/WebStorage/StorageAreaMap.messages.in
203 )
204
205 if (${WebCore_LIBRARY_TYPE} STREQUAL STATIC)
206     # Link with WebCore as PRIVATE not to propagate WebCore to all users of WebKit.
207     set(WebKit_LIBRARIES
208         PRIVATE WebCore
209         PUBLIC WebCoreHeaderInterface
210     )
211 else ()
212     # All users of WebKit need to link WebCore if WebCore is a shared library.
213     set(WebKit_LIBRARIES PUBLIC WebCore)
214 endif ()
215
216 set(WebProcess_LIBRARIES
217     WebKit
218 )
219
220 set(NetworkProcess_LIBRARIES
221     WebKit
222 )
223
224 set(PluginProcess_LIBRARIES
225     WebKit
226 )
227
228 if (ENABLE_GRAPHICS_CONTEXT_3D)
229     # For platforms that want to use system-provided OpenGL (ES) / EGL headers,
230     # these include directories, libraries or definitions need to be
231     # added before the ANGLE directories.
232     if (USE_LIBEPOXY)
233         list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
234             ${LIBEPOXY_INCLUDE_DIRS}
235         )
236         list(APPEND WebKit_LIBRARIES
237             PRIVATE ${LIBEPOXY_LIBRARIES}
238         )
239         add_definitions(${LIBEPOXY_DEFINITIONS})
240     else ()
241         if (USE_OPENGL)
242             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
243                 ${OPENGL_INCLUDE_DIRS}
244             )
245             list(APPEND WebKit_LIBRARIES
246                 PRIVATE ${OPENGL_LIBRARIES}
247             )
248             add_definitions(${OPENGL_DEFINITIONS})
249         elseif (USE_OPENGL_ES)
250             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
251                 ${OPENGLES2_INCLUDE_DIRS}
252             )
253             list(APPEND WebKit_LIBRARIES
254                 PRIVATE ${OPENGLES2_LIBRARIES}
255             )
256             add_definitions(${OPENGLES2_DEFINITIONS})
257         endif ()
258
259         if (USE_EGL)
260             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
261                 ${EGL_INCLUDE_DIRS}
262             )
263             list(APPEND WebKit_LIBRARIES
264                 PRIVATE ${EGL_LIBRARIES}
265             )
266             add_definitions(${EGL_DEFINITIONS})
267         endif ()
268     endif ()
269
270     list(APPEND WebKit_INCLUDE_DIRECTORIES
271         "${THIRDPARTY_DIR}/ANGLE"
272         "${THIRDPARTY_DIR}/ANGLE/include/KHR"
273     )
274 endif ()
275
276 if (WIN32 AND INTERNAL_BUILD)
277     set(JavaScriptCore_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore/Scripts")
278 else ()
279     set(JavaScriptCore_SCRIPTS_DIR "${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts")
280 endif ()
281
282 if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
283     list(APPEND WebKit_LIBRARIES PRIVATE atomic)
284 endif ()
285
286 if (UNIX)
287     check_function_exists(shm_open SHM_OPEN_EXISTS)
288     if (NOT SHM_OPEN_EXISTS)
289         set(CMAKE_REQUIRED_LIBRARIES rt)
290         check_function_exists(shm_open SHM_OPEN_REQUIRES_LIBRT)
291         if (SHM_OPEN_REQUIRES_LIBRT)
292             list(APPEND WebKit_LIBRARIES PRIVATE rt)
293         endif ()
294         unset(CMAKE_REQUIRED_LIBRARIES)
295     endif ()
296 endif ()
297
298 macro(ADD_WEBKIT_PREFIX_HEADER _target)
299     if (WebKit_USE_PREFIX_HEADER)
300         get_target_property(OLD_COMPILE_FLAGS ${_target} COMPILE_FLAGS)
301         if (${OLD_COMPILE_FLAGS} STREQUAL "OLD_COMPILE_FLAGS-NOTFOUND")
302             set(OLD_COMPILE_FLAGS "")
303         endif ()
304         set_target_properties(${_target} PROPERTIES COMPILE_FLAGS "${OLD_COMPILE_FLAGS} -include ${WEBKIT_DIR}/WebKit2Prefix.h")
305     endif ()
306 endmacro()
307
308 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_EXTRA_FLAGS
309 )
310
311 WEBKIT_FRAMEWORK_DECLARE(WebKit)
312 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
313
314 # Helper macro which wraps generate-message-receiver.py and generate-message-header.py scripts
315 #   _output_source is a list name which will contain generated sources.(eg. WebKit_SOURCES)
316 #   _input_files are messages.in files to generate.
317 macro(GENERATE_MESSAGE_SOURCES _output_source _input_files)
318     foreach (_file ${_input_files})
319         get_filename_component(_name ${_file} NAME_WE)
320         add_custom_command(
321             OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}MessageReceiver.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}Messages.h
322             MAIN_DEPENDENCY ${_file}
323             DEPENDS ${WEBKIT_DIR}/Scripts/webkit/__init__.py
324                     ${WEBKIT_DIR}/Scripts/webkit/messages.py
325                     ${WEBKIT_DIR}/Scripts/webkit/model.py
326                     ${WEBKIT_DIR}/Scripts/webkit/parser.py
327             COMMAND ${PYTHON_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-message-receiver.py ${_file} > ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}MessageReceiver.cpp
328             COMMAND ${PYTHON_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-messages-header.py ${_file} > ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}Messages.h
329             WORKING_DIRECTORY ${WEBKIT_DIR}
330             VERBATIM)
331
332         list(APPEND ${_output_source} ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}MessageReceiver.cpp)
333     endforeach ()
334 endmacro()
335 GENERATE_MESSAGE_SOURCES(WebKit_DERIVED_SOURCES "${WebKit_MESSAGES_IN_FILES}")
336
337 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS
338     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
339     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/cpp_generator.py
340     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
341     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
342     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
343     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
344     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
345     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
346     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
347     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generator.py
348     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generator_templates.py
349     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/models.py
350 )
351
352 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS
353     ${WEBKIT_DIR}/UIProcess/Automation/Automation.json
354 )
355
356 add_custom_command(
357     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.h ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.h ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.h ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.cpp
358     MAIN_DEPENDENCY ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS}
359     DEPENDS ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS}
360     COMMAND ${PYTHON_EXECUTABLE} ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py --outputDir "${DERIVED_SOURCES_WEBKIT_DIR}" --framework WebKit ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_EXTRA_FLAGS} --backend ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS}
361     VERBATIM)
362
363 list(APPEND WebKit_HEADERS
364     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.h
365     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.h
366     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.h
367 )
368
369 list(APPEND WebKit_SOURCES
370     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.cpp
371     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.cpp
372     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.cpp
373 )
374
375 add_custom_command(
376     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxyScriptSource.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js
377     MAIN_DEPENDENCY ${WEBKIT_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js
378     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
379     COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__InjectedScript_WebAutomationSessionProxy.js" > ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js
380     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${WEBKIT_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js >> ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js
381     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl WebAutomationSessionProxyScriptSource ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxyScriptSource.h
382     VERBATIM)
383
384 list(APPEND WebKit_HEADERS
385     ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxyScriptSource.h
386 )
387
388 set(WebKit_WEB_PREFERENCES_TEMPLATES
389     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb
390     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb
391     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb
392     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb
393     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb
394     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb
395     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb
396 )
397
398 add_custom_command(
399     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebPageUpdatePreferences.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesDefinitions.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesExperimentalFeatures.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesInternalDebugFeatures.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesStoreDefaultsMap.cpp
400     MAIN_DEPENDENCY ${WEBKIT_DIR}/Shared/WebPreferences.yaml
401     DEPENDS ${WebKit_WEB_PREFERENCES_TEMPLATES}
402     COMMAND ${RUBY_EXECUTABLE} ${WEBKIT_DIR}/Scripts/GeneratePreferences.rb --input ${WEBKIT_DIR}/Shared/WebPreferences.yaml --outputDir "${DERIVED_SOURCES_WEBKIT_DIR}"
403     VERBATIM)
404
405 list(APPEND WebKit_HEADERS
406     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesDefinitions.h
407     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.h
408 )
409
410 list(APPEND WebKit_SOURCES
411     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPageUpdatePreferences.cpp
412     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesExperimentalFeatures.cpp
413     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesInternalDebugFeatures.cpp
414     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.cpp
415     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesStoreDefaultsMap.cpp
416 )
417
418
419 list(APPEND WebKit_SOURCES ${WebKit_DERIVED_SOURCES})
420
421 WEBKIT_COMPUTE_SOURCES(WebKit)
422
423 WEBKIT_FRAMEWORK(WebKit)
424 add_dependencies(WebKit WebCore ${WEBKIT_EXTRA_DEPENDENCIES})
425 ADD_WEBKIT_PREFIX_HEADER(WebKit)
426
427 add_executable(WebProcess ${WebProcess_SOURCES})
428 ADD_WEBKIT_PREFIX_HEADER(WebProcess)
429 target_link_libraries(WebProcess ${WebProcess_LIBRARIES})
430
431 if (WebKit_WebProcess_OUTPUT_NAME)
432     set_target_properties(WebProcess PROPERTIES OUTPUT_NAME ${WebKit_WebProcess_OUTPUT_NAME})
433 endif ()
434
435 add_executable(NetworkProcess ${NetworkProcess_SOURCES})
436 ADD_WEBKIT_PREFIX_HEADER(NetworkProcess)
437 target_link_libraries(NetworkProcess ${NetworkProcess_LIBRARIES})
438
439 if (WebKit_NetworkProcess_OUTPUT_NAME)
440     set_target_properties(NetworkProcess PROPERTIES OUTPUT_NAME ${WebKit_NetworkProcess_OUTPUT_NAME})
441 endif ()
442
443 if (COMPILER_IS_GCC_OR_CLANG)
444     WEBKIT_ADD_TARGET_CXX_FLAGS(WebKit -Wno-unused-parameter)
445     WEBKIT_ADD_TARGET_CXX_FLAGS(WebProcess -Wno-unused-parameter)
446     WEBKIT_ADD_TARGET_CXX_FLAGS(NetworkProcess -Wno-unused-parameter)
447 endif ()
448
449 # FIXME: Mac should build a plugin process.
450 if (ENABLE_PLUGIN_PROCESS AND NOT "${PORT}" STREQUAL "Mac")
451     add_definitions(-DENABLE_PLUGIN_PROCESS=1)
452     add_executable(PluginProcess ${PluginProcess_SOURCES})
453     ADD_WEBKIT_PREFIX_HEADER(PluginProcess)
454     target_link_libraries(PluginProcess ${PluginProcess_LIBRARIES})
455     install(TARGETS PluginProcess DESTINATION "${LIBEXEC_INSTALL_DIR}")
456
457     if (COMPILER_IS_GCC_OR_CLANG)
458         WEBKIT_ADD_TARGET_CXX_FLAGS(PluginProcess -Wno-unused-parameter)
459     endif ()
460
461     if (WebKit_PluginProcess_OUTPUT_NAME)
462       set_target_properties(PluginProcess PROPERTIES OUTPUT_NAME ${WebKit_PluginProcess_OUTPUT_NAME})
463     endif ()
464 endif ()
465
466 if ("${PORT}" STREQUAL "Mac")
467     WEBKIT_DEFINE_XPC_SERVICES()
468 else ()
469     WEBKIT_POPULATE_LIBRARY_VERSION(WEBKIT)
470
471     set_target_properties(WebKit PROPERTIES VERSION ${WEBKIT_VERSION} SOVERSION ${WEBKIT_VERSION_MAJOR})
472
473     install(TARGETS WebKit WebProcess NetworkProcess
474         LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
475         RUNTIME DESTINATION "${LIBEXEC_INSTALL_DIR}"
476     )
477 endif ()