[CMake] [GTK] Organize and clean up unused CMake variables
[WebKit-https.git] / Source / WebKit2 / PlatformGTK.cmake
1 set(WebKit2_OUTPUT_NAME webkit2gtk-${WEBKITGTK_API_VERSION})
2 set(WebKit2_WebProcess_OUTPUT_NAME WebKitWebProcess)
3 set(WebKit2_NetworkProcess_OUTPUT_NAME WebKitNetworkProcess)
4 set(WebKit2_PluginProcess_OUTPUT_NAME WebKitPluginProcess)
5 set(WebKit2_DatabaseProcess_OUTPUT_NAME WebKitDatabaseProcess)
6
7 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT2_DIR})
8 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR})
9 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WEBKIT2GTK_DIR})
10 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR})
11
12 configure_file(UIProcess/API/gtk/WebKitVersion.h.in ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitVersion.h)
13 configure_file(webkit2gtk.pc.in ${WebKit2_PKGCONFIG_FILE} @ONLY)
14 configure_file(webkit2gtk-web-extension.pc.in ${WebKit2WebExtension_PKGCONFIG_FILE} @ONLY)
15
16 add_definitions(-DBUILDING_WEBKIT)
17 add_definitions(-DWEBKIT2_COMPILATION)
18 add_definitions(-DLIBEXECDIR="${LIBEXEC_INSTALL_DIR}")
19 add_definitions(-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
20 add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
21
22 set(WebKit2_USE_PREFIX_HEADER ON)
23
24 list(APPEND WebKit2_SOURCES
25     DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp
26
27     NetworkProcess/cache/NetworkCacheDataSoup.cpp
28     NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp
29
30     NetworkProcess/gtk/NetworkProcessMainGtk.cpp
31
32     NetworkProcess/soup/NetworkProcessSoup.cpp
33     NetworkProcess/soup/NetworkResourceLoadSchedulerSoup.cpp
34     NetworkProcess/soup/RemoteNetworkingContextSoup.cpp
35
36     Platform/IPC/unix/AttachmentUnix.cpp
37     Platform/IPC/unix/ConnectionUnix.cpp
38
39     Platform/gtk/LoggingGtk.cpp
40     Platform/gtk/ModuleGtk.cpp
41
42     Platform/unix/SharedMemoryUnix.cpp
43
44     PluginProcess/unix/PluginControllerProxyUnix.cpp
45     PluginProcess/unix/PluginProcessMainUnix.cpp
46     PluginProcess/unix/PluginProcessUnix.cpp
47
48     Shared/API/c/cairo/WKImageCairo.cpp
49
50     Shared/Downloads/gtk/DownloadSoupErrorsGtk.cpp
51
52     Shared/Downloads/soup/DownloadSoup.cpp
53
54     Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp
55     Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
56
57     Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
58
59     Shared/cairo/ShareableBitmapCairo.cpp
60
61     Shared/gtk/ArgumentCodersGtk.cpp
62     Shared/gtk/KeyedEncoder.cpp
63     Shared/gtk/KeyedDecoder.cpp
64     Shared/gtk/NativeContextMenuItemGtk.cpp
65     Shared/gtk/NativeWebKeyboardEventGtk.cpp
66     Shared/gtk/NativeWebMouseEventGtk.cpp
67     Shared/gtk/NativeWebTouchEventGtk.cpp
68     Shared/gtk/NativeWebWheelEventGtk.cpp
69     Shared/gtk/PrintInfoGtk.cpp
70     Shared/gtk/ProcessExecutablePathGtk.cpp
71     Shared/gtk/WebEventFactory.cpp
72
73     Shared/linux/WebMemorySamplerLinux.cpp
74
75     Shared/linux/SeccompFilters/OpenSyscall.cpp
76     Shared/linux/SeccompFilters/SeccompBroker.cpp
77     Shared/linux/SeccompFilters/SeccompFilters.cpp
78     Shared/linux/SeccompFilters/SigactionSyscall.cpp
79     Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp
80     Shared/linux/SeccompFilters/Syscall.cpp
81     Shared/linux/SeccompFilters/SyscallPolicy.cpp
82
83     Shared/soup/WebCoreArgumentCodersSoup.cpp
84
85     Shared/unix/ChildProcessMain.cpp
86
87     UIProcess/BackingStore.cpp
88
89     UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp
90
91     UIProcess/DefaultUndoController.cpp
92     UIProcess/DrawingAreaProxyImpl.cpp
93
94     UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
95
96     UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp
97     UIProcess/API/C/gtk/WKInspectorClientGtk.cpp
98     UIProcess/API/C/gtk/WKView.cpp
99
100     UIProcess/API/C/soup/WKCookieManagerSoup.cpp
101     UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp
102
103     UIProcess/API/gtk/PageClientImpl.cpp
104     UIProcess/API/gtk/PageClientImpl.h
105     UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
106     UIProcess/API/gtk/WebKitAuthenticationDialog.h
107     UIProcess/API/gtk/WebKitAuthenticationRequest.cpp
108     UIProcess/API/gtk/WebKitAuthenticationRequest.h
109     UIProcess/API/gtk/WebKitBackForwardList.cpp
110     UIProcess/API/gtk/WebKitBackForwardList.h
111     UIProcess/API/gtk/WebKitBackForwardListItem.cpp
112     UIProcess/API/gtk/WebKitBackForwardListItem.h
113     UIProcess/API/gtk/WebKitBackForwardListPrivate.h
114     UIProcess/API/gtk/WebKitColorChooser.cpp
115     UIProcess/API/gtk/WebKitColorChooserRequest.cpp
116     UIProcess/API/gtk/WebKitContextMenu.cpp
117     UIProcess/API/gtk/WebKitContextMenu.h
118     UIProcess/API/gtk/WebKitContextMenuActions.cpp
119     UIProcess/API/gtk/WebKitContextMenuActions.h
120     UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h
121     UIProcess/API/gtk/WebKitContextMenuClient.cpp
122     UIProcess/API/gtk/WebKitContextMenuClient.h
123     UIProcess/API/gtk/WebKitContextMenuItem.cpp
124     UIProcess/API/gtk/WebKitContextMenuItem.h
125     UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
126     UIProcess/API/gtk/WebKitContextMenuPrivate.h
127     UIProcess/API/gtk/WebKitCookieManager.cpp
128     UIProcess/API/gtk/WebKitCookieManager.h
129     UIProcess/API/gtk/WebKitCookieManagerPrivate.h
130     UIProcess/API/gtk/WebKitCredential.cpp
131     UIProcess/API/gtk/WebKitCredential.h
132     UIProcess/API/gtk/WebKitDefines.h
133     UIProcess/API/gtk/WebKitDownload.cpp
134     UIProcess/API/gtk/WebKitDownload.h
135     UIProcess/API/gtk/WebKitDownloadClient.cpp
136     UIProcess/API/gtk/WebKitDownloadClient.h
137     UIProcess/API/gtk/WebKitDownloadPrivate.h
138     UIProcess/API/gtk/WebKitEditingCommands.h
139     UIProcess/API/gtk/WebKitError.cpp
140     UIProcess/API/gtk/WebKitError.h
141     UIProcess/API/gtk/WebKitFaviconDatabase.cpp
142     UIProcess/API/gtk/WebKitFaviconDatabase.h
143     UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h
144     UIProcess/API/gtk/WebKitFileChooserRequest.cpp
145     UIProcess/API/gtk/WebKitFileChooserRequest.h
146     UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h
147     UIProcess/API/gtk/WebKitFindController.cpp
148     UIProcess/API/gtk/WebKitFindController.h
149     UIProcess/API/gtk/WebKitFormClient.cpp
150     UIProcess/API/gtk/WebKitFormClient.h
151     UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp
152     UIProcess/API/gtk/WebKitFormSubmissionRequest.h
153     UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h
154     UIProcess/API/gtk/WebKitForwardDeclarations.h
155     UIProcess/API/gtk/WebKitFullscreenClient.cpp
156     UIProcess/API/gtk/WebKitFullscreenClient.h
157     UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp
158     UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
159     UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h
160     UIProcess/API/gtk/WebKitGeolocationProvider.cpp
161     UIProcess/API/gtk/WebKitGeolocationProvider.h
162     UIProcess/API/gtk/WebKitHitTestResult.cpp
163     UIProcess/API/gtk/WebKitHitTestResult.h
164     UIProcess/API/gtk/WebKitHitTestResultPrivate.h
165     UIProcess/API/gtk/WebKitInjectedBundleClient.cpp
166     UIProcess/API/gtk/WebKitInjectedBundleClient.h
167     UIProcess/API/gtk/WebKitJavascriptResult.cpp
168     UIProcess/API/gtk/WebKitJavascriptResult.h
169     UIProcess/API/gtk/WebKitJavascriptResultPrivate.h
170     UIProcess/API/gtk/WebKitLoaderClient.cpp
171     UIProcess/API/gtk/WebKitLoaderClient.h
172     UIProcess/API/gtk/WebKitMimeInfo.cpp
173     UIProcess/API/gtk/WebKitMimeInfo.h
174     UIProcess/API/gtk/WebKitMimeInfoPrivate.h
175     UIProcess/API/gtk/WebKitNavigationAction.cpp
176     UIProcess/API/gtk/WebKitNavigationAction.h
177     UIProcess/API/gtk/WebKitNavigationActionPrivate.h
178     UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
179     UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
180     UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
181     UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp
182     UIProcess/API/gtk/WebKitNotificationPermissionRequest.h
183     UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h
184     UIProcess/API/gtk/WebKitNotificationProvider.cpp
185     UIProcess/API/gtk/WebKitNotificationProvider.h
186     UIProcess/API/gtk/WebKitNotification.cpp
187     UIProcess/API/gtk/WebKitNotification.h
188     UIProcess/API/gtk/WebKitNotificationPrivate.h
189     UIProcess/API/gtk/WebKitPermissionRequest.cpp
190     UIProcess/API/gtk/WebKitPermissionRequest.h
191     UIProcess/API/gtk/WebKitPlugin.cpp
192     UIProcess/API/gtk/WebKitPlugin.h
193     UIProcess/API/gtk/WebKitPluginPrivate.h
194     UIProcess/API/gtk/WebKitPolicyClient.cpp
195     UIProcess/API/gtk/WebKitPolicyClient.h
196     UIProcess/API/gtk/WebKitPolicyDecision.cpp
197     UIProcess/API/gtk/WebKitPolicyDecision.h
198     UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h
199     UIProcess/API/gtk/WebKitPrintOperation.cpp
200     UIProcess/API/gtk/WebKitPrintOperation.h
201     UIProcess/API/gtk/WebKitPrintOperationPrivate.h
202     UIProcess/API/gtk/WebKitPrivate.cpp
203     UIProcess/API/gtk/WebKitPrivate.h
204     UIProcess/API/gtk/WebKitRequestManagerClient.cpp
205     UIProcess/API/gtk/WebKitRequestManagerClient.h
206     UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp
207     UIProcess/API/gtk/WebKitResponsePolicyDecision.h
208     UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h
209     UIProcess/API/gtk/WebKitScriptDialog.cpp
210     UIProcess/API/gtk/WebKitScriptDialog.h
211     UIProcess/API/gtk/WebKitScriptDialogPrivate.h
212     UIProcess/API/gtk/WebKitSecurityManager.cpp
213     UIProcess/API/gtk/WebKitSecurityManager.h
214     UIProcess/API/gtk/WebKitSecurityManagerPrivate.h
215     UIProcess/API/gtk/WebKitSettings.cpp
216     UIProcess/API/gtk/WebKitSettings.h
217     UIProcess/API/gtk/WebKitSettingsPrivate.h
218     UIProcess/API/gtk/WebKitTextChecker.cpp
219     UIProcess/API/gtk/WebKitTextChecker.h
220     UIProcess/API/gtk/WebKitUIClient.cpp
221     UIProcess/API/gtk/WebKitUIClient.h
222     UIProcess/API/gtk/WebKitURIRequest.cpp
223     UIProcess/API/gtk/WebKitURIRequest.h
224     UIProcess/API/gtk/WebKitURIRequestPrivate.h
225     UIProcess/API/gtk/WebKitURIResponse.cpp
226     UIProcess/API/gtk/WebKitURIResponse.h
227     UIProcess/API/gtk/WebKitURIResponsePrivate.h
228     UIProcess/API/gtk/WebKitURISchemeRequest.cpp
229     UIProcess/API/gtk/WebKitURISchemeRequest.h
230     UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h
231     UIProcess/API/gtk/WebKitUserContent.h
232     UIProcess/API/gtk/WebKitUserContent.cpp
233     UIProcess/API/gtk/WebKitUserContentPrivate.h
234     UIProcess/API/gtk/WebKitUserContentManager.h
235     UIProcess/API/gtk/WebKitUserContentManagerPrivate.h
236     UIProcess/API/gtk/WebKitUserContentManager.cpp
237     UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp
238     UIProcess/API/gtk/WebKitUserMediaPermissionRequest.h
239     UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h
240     UIProcess/API/gtk/WebKitVersion.cpp
241     UIProcess/API/gtk/WebKitVersion.h.in
242     UIProcess/API/gtk/WebKitWebContext.cpp
243     UIProcess/API/gtk/WebKitWebContext.h
244     UIProcess/API/gtk/WebKitWebContextPrivate.h
245     UIProcess/API/gtk/WebKitWebInspector.cpp
246     UIProcess/API/gtk/WebKitWebInspector.h
247     UIProcess/API/gtk/WebKitWebInspectorPrivate.h
248     UIProcess/API/gtk/WebKitWebResource.cpp
249     UIProcess/API/gtk/WebKitWebResource.h
250     UIProcess/API/gtk/WebKitWebResourcePrivate.h
251     UIProcess/API/gtk/WebKitWebView.cpp
252     UIProcess/API/gtk/WebKitWebView.h
253     UIProcess/API/gtk/WebKitWebViewBase.cpp
254     UIProcess/API/gtk/WebKitWebViewBase.h
255     UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp
256     UIProcess/API/gtk/WebKitWebViewBaseAccessible.h
257     UIProcess/API/gtk/WebKitWebViewBasePrivate.h
258     UIProcess/API/gtk/WebKitWebViewPrivate.h
259     UIProcess/API/gtk/WebKitWindowProperties.cpp
260     UIProcess/API/gtk/WebKitWindowProperties.h
261     UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h
262     UIProcess/API/gtk/webkit2.h
263
264     UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
265
266     UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp
267
268     UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
269
270     UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp
271     UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
272     UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
273
274     UIProcess/Plugins/gtk/PluginInfoCache.cpp
275
276     UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
277     UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
278
279     UIProcess/Storage/StorageManager.cpp
280
281     UIProcess/cairo/BackingStoreCairo.cpp
282
283     UIProcess/gtk/DragAndDropHandler.cpp
284     UIProcess/gtk/ExperimentalFeatures.cpp
285     UIProcess/gtk/GestureController.cpp
286     UIProcess/gtk/InputMethodFilter.cpp
287     UIProcess/gtk/RedirectedXCompositeWindow.cpp
288     UIProcess/gtk/TextCheckerGtk.cpp
289     UIProcess/gtk/WebColorPickerGtk.cpp
290     UIProcess/gtk/WebContextMenuProxyGtk.cpp
291     UIProcess/gtk/WebFullScreenClientGtk.cpp
292     UIProcess/gtk/WebInspectorClientGtk.cpp
293     UIProcess/gtk/WebInspectorProxyGtk.cpp
294     UIProcess/gtk/WebPageProxyGtk.cpp
295     UIProcess/gtk/WebPopupMenuProxyGtk.cpp
296     UIProcess/gtk/WebPreferencesGtk.cpp
297     UIProcess/gtk/WebProcessPoolGtk.cpp
298     UIProcess/gtk/WebProcessProxyGtk.cpp
299
300     UIProcess/Network/soup/NetworkProcessProxySoup.cpp
301     UIProcess/soup/WebCookieManagerProxySoup.cpp
302     UIProcess/soup/WebProcessPoolSoup.cpp
303
304     WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
305     WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp
306
307     WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp
308     WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp
309     WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp
310     WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp
311     WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp
312
313     WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp
314
315     WebProcess/MediaCache/WebMediaKeyStorageManager.cpp
316
317     WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp
318
319     WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
320
321     WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp
322     WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp
323     WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
324     WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp
325     WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp
326
327     WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
328
329     WebProcess/WebPage/DrawingAreaImpl.cpp
330
331     WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
332
333     WebProcess/WebPage/gtk/PrinterListGtk.cpp
334     WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp
335     WebProcess/WebPage/gtk/WebPageGtk.cpp
336     WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
337
338     WebProcess/gtk/WebGtkExtensionManager.cpp
339     WebProcess/gtk/WebGtkInjectedBundleMain.cpp
340     WebProcess/gtk/WebProcessMainGtk.cpp
341
342     WebProcess/soup/WebKitSoupRequestGeneric.cpp
343     WebProcess/soup/WebKitSoupRequestInputStream.cpp
344     WebProcess/soup/WebProcessSoup.cpp
345 )
346
347 list(APPEND WebKit2_DERIVED_SOURCES
348     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
349     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
350     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c
351
352     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
353     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
354 )
355
356 set(WebKit2GTK_INSTALLED_HEADERS
357     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
358     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitVersion.h
359     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitAuthenticationRequest.h
360     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardList.h
361     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardListItem.h
362     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitColorChooserRequest.h
363     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCredential.h
364     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h
365     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h
366     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.h
367     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCookieManager.h
368     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitDefines.h
369     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitDownload.h
370     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEditingCommands.h
371     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitError.h
372     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFaviconDatabase.h
373     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFileChooserRequest.h
374     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFindController.h
375     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFormSubmissionRequest.h
376     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitForwardDeclarations.h
377     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
378     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
379     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitJavascriptResult.h
380     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitMimeInfo.h
381     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationAction.h
382     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
383     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNotificationPermissionRequest.h
384     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNotification.h
385     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPermissionRequest.h
386     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPlugin.h
387     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPolicyDecision.h
388     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPrintOperation.h
389     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitResponsePolicyDecision.h
390     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitScriptDialog.h
391     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitSecurityManager.h
392     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitSettings.h
393     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIRequest.h
394     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIResponse.h
395     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURISchemeRequest.h
396     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitUserContent.h
397     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitUserContentManager.h
398     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.h
399     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebContext.h
400     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebInspector.h
401     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebResource.h
402     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebView.h
403     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebViewBase.h
404     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWindowProperties.h
405     ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2.h
406 )
407
408 set(WebKit2WebExtension_INSTALLED_HEADERS
409     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitFrame.h
410     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h
411     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h
412     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h
413     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h
414     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h
415 )
416
417 file(GLOB InspectorFiles
418     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
419     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
420     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
421     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
422     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
423     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
424     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/ESLint/*.js
425     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
426     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
427     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
428     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
429     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
430     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
431     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
432 )
433
434 # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
435 # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
436 add_custom_command(
437     OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
438     DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
439     COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
440 )
441
442 list(APPEND InspectorFiles
443     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
444     ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
445 )
446
447 # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
448 list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
449     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
450     "${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}"
451     "${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}"
452     "${DERIVED_SOURCES_WEBKIT2GTK_DIR}"
453 )
454
455 list(APPEND WebKit2_INCLUDE_DIRECTORIES
456     "${WEBKIT2_DIR}/PluginProcess/unix"
457     "${WEBCORE_DIR}/platform/cairo"
458     "${WEBCORE_DIR}/platform/gtk"
459     "${WEBCORE_DIR}/platform/graphics/cairo"
460     "${WEBCORE_DIR}/platform/graphics/opentype"
461     "${WEBCORE_DIR}/platform/network/soup"
462     "${WEBCORE_DIR}/platform/text/enchant"
463     "${WEBKIT2_DIR}/DatabaseProcess/unix"
464     "${WEBKIT2_DIR}/NetworkProcess/gtk"
465     "${WEBKIT2_DIR}/NetworkProcess/unix"
466     "${WEBKIT2_DIR}/Shared/API/c/gtk"
467     "${WEBKIT2_DIR}/Shared/Network/CustomProtocols/soup"
468     "${WEBKIT2_DIR}/Shared/Downloads/soup"
469     "${WEBKIT2_DIR}/Shared/gtk"
470     "${WEBKIT2_DIR}/Shared/soup"
471     "${WEBKIT2_DIR}/Shared/unix"
472     "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
473     "${WEBKIT2_DIR}/UIProcess/API/C/gtk"
474     "${WEBKIT2_DIR}/UIProcess/API/C/soup"
475     "${WEBKIT2_DIR}/UIProcess/API/cpp/gtk"
476     "${WEBKIT2_DIR}/UIProcess/API/gtk"
477     "${WEBKIT2_DIR}/UIProcess/Network/CustomProtocols/soup"
478     "${WEBKIT2_DIR}/UIProcess/Plugins/gtk"
479     "${WEBKIT2_DIR}/UIProcess/gtk"
480     "${WEBKIT2_DIR}/UIProcess/soup"
481     "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk"
482     "${WEBKIT2_DIR}/WebProcess/gtk"
483     "${WEBKIT2_DIR}/WebProcess/soup"
484     "${WEBKIT2_DIR}/WebProcess/unix"
485     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/gtk"
486     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/soup"
487     "${WEBKIT2_DIR}/WebProcess/WebPage/atk"
488     "${WEBKIT2_DIR}/WebProcess/WebPage/gtk"
489     "${WTF_DIR}/wtf/gtk/"
490     "${WTF_DIR}/wtf/gobject"
491     ${WTF_DIR}
492     ${CAIRO_INCLUDE_DIRS}
493     ${ENCHANT_INCLUDE_DIRS}
494     ${GEOCLUE_INCLUDE_DIRS}
495     ${HARFBUZZ_INCLUDE_DIRS}
496     ${LIBSOUP_INCLUDE_DIRS}
497 )
498
499 if (LIBNOTIFY_FOUND)
500 list(APPEND WebKit2_INCLUDE_DIRECTORIES
501     ${LIBNOTIFY_INCLUDE_DIRS}
502 )
503 endif ()
504
505 set(WebKit2CommonIncludeDirectories ${WebKit2_INCLUDE_DIRECTORIES})
506
507 list(APPEND WebKit2_INCLUDE_DIRECTORIES
508     ${GLIB_INCLUDE_DIRS}
509     ${GTK_INCLUDE_DIRS}
510     ${GTK_UNIX_PRINT_INCLUDE_DIRS}
511 )
512
513 list(APPEND WebProcess_SOURCES
514     WebProcess/EntryPoint/unix/WebProcessMain.cpp
515 )
516
517 list(APPEND NetworkProcess_SOURCES
518     NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp
519 )
520
521 list(APPEND DatabaseProcess_SOURCES
522     DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp
523 )
524
525 file(WRITE ${CMAKE_BINARY_DIR}/test_atomic.cpp
526      "#include <atomic>\n"
527      "int main() { std::atomic<int64_t> i(0); i++; return 0; }\n")
528 try_compile(ATOMIC_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomic.cpp)
529 if (NOT ATOMIC_BUILD_SUCCEEDED)
530     list(APPEND WebKit2_LIBRARIES atomic)
531 endif ()
532 file(REMOVE ${CMAKE_BINARY_DIR}/test_atomic.cpp)
533
534 set(SharedWebKit2Libraries
535     ${WebKit2_LIBRARIES}
536 )
537
538 list(APPEND WebKit2_LIBRARIES
539     GObjectDOMBindings
540     WebCorePlatformGTK
541     ${GTK_UNIX_PRINT_LIBRARIES}
542 )
543
544 if (LIBNOTIFY_FOUND)
545 list(APPEND WebKit2_LIBRARIES
546     ${LIBNOTIFY_LIBRARIES}
547 )
548 endif ()
549
550 ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
551
552 set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
553 add_custom_command(
554     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
555            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.h
556     MAIN_DEPENDENCY ${WebKit2_MARSHAL_LIST}
557
558     COMMAND echo extern \"C\" { > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
559     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --body >> ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
560     COMMAND echo } >> ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
561
562     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --header > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.h
563     VERBATIM)
564
565 # To generate WebKitEnumTypes.h we want to use all installed headers, except WebKitEnumTypes.h itself.
566 set(WebKit2GTK_ENUM_GENERATION_HEADERS ${WebKit2GTK_INSTALLED_HEADERS})
567 list(REMOVE_ITEM WebKit2GTK_ENUM_GENERATION_HEADERS ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h)
568 add_custom_command(
569     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
570            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
571     DEPENDS ${WebKit2GTK_ENUM_GENERATION_HEADERS}
572
573     COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.h.template ${WebKit2GTK_ENUM_GENERATION_HEADERS} | sed s/web_kit/webkit/ | sed s/WEBKIT_TYPE_KIT/WEBKIT_TYPE/ > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
574
575     COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.cpp.template ${WebKit2GTK_ENUM_GENERATION_HEADERS} | sed s/web_kit/webkit/ > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
576     VERBATIM)
577
578 add_custom_command(
579     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
580     DEPENDS ${InspectorFiles}
581             ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
582     COMMAND ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles}
583     VERBATIM
584 )
585
586 add_custom_command(
587     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
588     DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
589     COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI --sourcedir=${DERIVED_SOURCES_WEBINSPECTORUI_DIR} --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
590     VERBATIM
591 )
592
593 add_custom_command(
594     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
595     DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
596             ${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
597     COMMAND glib-compile-resources --generate --sourcedir=${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
598     VERBATIM
599 )
600
601 set(WebKit2Resources
602     "        <file alias=\"images/missingImage\">missingImage.png</file>\n"
603     "        <file alias=\"images/missingImage@2x\">missingImage@2x.png</file>\n"
604     "        <file alias=\"images/panIcon\">panIcon.png</file>\n"
605     "        <file alias=\"images/textAreaResizeCorner\">textAreaResizeCorner.png</file>\n"
606     "        <file alias=\"images/textAreaResizeCorner@2x\">textAreaResizeCorner@2x.png</file>\n"
607 )
608
609 if (ENABLE_ICONDATABASE)
610     list(APPEND WebKit2Resources
611         "        <file alias=\"images/urlIcon\">urlIcon.png</file>\n"
612     )
613 endif ()
614
615 if (ENABLE_WEB_AUDIO)
616     list(APPEND WebKit2Resources
617         "        <file alias=\"audio/Composite\">Composite.wav</file>\n"
618     )
619 endif ()
620
621 file(WRITE ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
622     "<?xml version=1.0 encoding=UTF-8?>\n"
623     "<gresources>\n"
624     "    <gresource prefix=\"/org/webkitgtk/resources\">\n"
625     ${WebKit2Resources}
626     "    </gresource>\n"
627     "</gresources>\n"
628 )
629
630 add_custom_command(
631     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c
632     DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
633     COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/Resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/platform/audio/resources --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
634     VERBATIM
635 )
636
637 if (ENABLE_PLUGIN_PROCESS_GTK2)
638     set(PluginProcessGTK2_EXECUTABLE_NAME WebKitPluginProcess2)
639
640     # FIXME: We should figure out a way to avoid compiling files that are common between the plugin
641     # process and WebKit2 only once instead of recompiling them for the plugin process.
642     list(APPEND PluginProcessGTK2_SOURCES
643         Platform/Logging.cpp
644         Platform/Module.cpp
645
646         Platform/IPC/ArgumentCoders.cpp
647         Platform/IPC/ArgumentDecoder.cpp
648         Platform/IPC/ArgumentEncoder.cpp
649         Platform/IPC/Attachment.cpp
650         Platform/IPC/Connection.cpp
651         Platform/IPC/DataReference.cpp
652         Platform/IPC/MessageDecoder.cpp
653         Platform/IPC/MessageEncoder.cpp
654         Platform/IPC/MessageReceiverMap.cpp
655         Platform/IPC/MessageSender.cpp
656         Platform/IPC/StringReference.cpp
657
658         Platform/IPC/unix/AttachmentUnix.cpp
659         Platform/IPC/unix/ConnectionUnix.cpp
660
661         Platform/gtk/LoggingGtk.cpp
662         Platform/gtk/ModuleGtk.cpp
663
664         Platform/unix/SharedMemoryUnix.cpp
665
666         PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
667
668         PluginProcess/PluginControllerProxy.cpp
669         PluginProcess/PluginCreationParameters.cpp
670         PluginProcess/PluginProcess.cpp
671         PluginProcess/WebProcessConnection.cpp
672
673         PluginProcess/unix/PluginControllerProxyUnix.cpp
674         PluginProcess/unix/PluginProcessMainUnix.cpp
675         PluginProcess/unix/PluginProcessUnix.cpp
676
677         Shared/ActivityAssertion.cpp
678         Shared/BlobDataFileReferenceWithSandboxExtension.cpp
679         Shared/ChildProcess.cpp
680         Shared/ChildProcessProxy.cpp
681         Shared/ConnectionStack.cpp
682         Shared/ShareableBitmap.cpp
683         Shared/WebCoreArgumentCoders.cpp
684         Shared/WebEvent.cpp
685         Shared/WebKeyboardEvent.cpp
686         Shared/WebKit2Initialize.cpp
687         Shared/WebMouseEvent.cpp
688         Shared/WebPlatformTouchPoint.cpp
689         Shared/WebTouchEvent.cpp
690         Shared/WebWheelEvent.cpp
691
692         Shared/Plugins/NPIdentifierData.cpp
693         Shared/Plugins/NPObjectMessageReceiver.cpp
694         Shared/Plugins/NPObjectProxy.cpp
695         Shared/Plugins/NPRemoteObjectMap.cpp
696         Shared/Plugins/NPVariantData.cpp
697         Shared/Plugins/PluginProcessCreationParameters.cpp
698
699         Shared/Plugins/Netscape/NetscapePluginModule.cpp
700         Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp
701
702         Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
703
704         Shared/cairo/ShareableBitmapCairo.cpp
705
706         Shared/gtk/NativeWebKeyboardEventGtk.cpp
707         Shared/gtk/NativeWebMouseEventGtk.cpp
708         Shared/gtk/NativeWebTouchEventGtk.cpp
709         Shared/gtk/NativeWebWheelEventGtk.cpp
710         Shared/gtk/ProcessExecutablePathGtk.cpp
711         Shared/gtk/WebEventFactory.cpp
712
713         Shared/soup/WebCoreArgumentCodersSoup.cpp
714
715         Shared/unix/ChildProcessMain.cpp
716
717         UIProcess/Launcher/ProcessLauncher.cpp
718
719         UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
720
721         UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
722
723         WebProcess/Plugins/Plugin.cpp
724
725         WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp
726         WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
727         WebProcess/Plugins/Netscape/NetscapePlugin.cpp
728         WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
729         WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
730
731         WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
732
733         ${DERIVED_SOURCES_WEBKIT2_DIR}/PluginControllerProxyMessageReceiver.cpp
734         ${DERIVED_SOURCES_WEBKIT2_DIR}/PluginProcessMessageReceiver.cpp
735         ${DERIVED_SOURCES_WEBKIT2_DIR}/WebProcessConnectionMessageReceiver.cpp
736
737         ${DERIVED_SOURCES_WEBKIT2_DIR}/NPObjectMessageReceiverMessageReceiver.cpp
738     )
739
740     add_executable(WebKitPluginProcess2 ${PluginProcessGTK2_SOURCES})
741     add_webkit2_prefix_header(WebKitPluginProcess2)
742
743     # We need ENABLE_PLUGIN_PROCESS for all targets in this directory, but
744     # we only want GTK_API_VERSION_2 for the plugin process target.
745     set_property(
746         TARGET WebKitPluginProcess2
747         APPEND
748         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
749     )
750     set_property(
751         TARGET WebKitPluginProcess2
752         APPEND
753         PROPERTY INCLUDE_DIRECTORIES
754             ${WebKit2CommonIncludeDirectories}
755             ${GTK2_INCLUDE_DIRS}
756             ${GDK2_INCLUDE_DIRS}
757     )
758
759     set(WebKitPluginProcess2_LIBRARIES
760         ${SharedWebKit2Libraries}
761         WebCorePlatformGTK2
762     )
763     ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKitPluginProcess2_LIBRARIES)
764     target_link_libraries(WebKitPluginProcess2 ${WebKitPluginProcess2_LIBRARIES})
765
766     add_dependencies(WebKitPluginProcess2 WebKit2)
767
768     install(TARGETS WebKitPluginProcess2 DESTINATION "${LIBEXEC_INSTALL_DIR}")
769 endif () # ENABLE_PLUGIN_PROCESS_GTK2
770
771 # GTK3 PluginProcess
772 list(APPEND PluginProcess_SOURCES
773     PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
774 )
775
776 if (ENABLE_THREADED_COMPOSITOR)
777     list(APPEND WebKit2_SOURCES
778         Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
779         Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
780         Shared/CoordinatedGraphics/SimpleViewportController.cpp
781         Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
782         Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
783         WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
784     )
785     list(APPEND WebKit2_INCLUDE_DIRECTORIES
786         "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
787         "${WEBKIT2_DIR}/Shared/CoordinatedGraphics"
788         "${WEBKIT2_DIR}/Shared/CoordinatedGraphics/threadedcompositor"
789         "${WEBKIT2_DIR}/WebProcess/WebPage/CoordinatedGraphics"
790     )
791 else (ENABLE_THREADED_COMPOSITOR)
792     list(APPEND WebKit2_SOURCES
793         WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
794     )
795 endif ()
796
797 # Commands for building the built-in injected bundle.
798 include_directories(
799     "${WEBKIT2_DIR}/Platform"
800     "${WEBKIT2_DIR}/Shared"
801     "${WEBKIT2_DIR}/Shared/API/c"
802     "${WEBKIT2_DIR}/UIProcess/API/C"
803     "${WEBKIT2_DIR}/WebProcess/InjectedBundle"
804     "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c"
805     "${DERIVED_SOURCES_DIR}"
806     "${DERIVED_SOURCES_DIR}/InjectedBundle"
807     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
808     "${FORWARDING_HEADERS_DIR}"
809     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
810 )
811
812 add_library(webkit2gtkinjectedbundle MODULE "${WEBKIT2_DIR}/WebProcess/gtk/WebGtkInjectedBundleMain.cpp")
813 add_dependencies(webkit2gtkinjectedbundle GObjectDOMBindings)
814 add_webkit2_prefix_header(webkit2gtkinjectedbundle)
815
816 # Add ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} to LD_LIBRARY_PATH
817 string(COMPARE EQUAL "$ENV{LD_LIBRARY_PATH}" "" ld_library_path_not_exist)
818 if (ld_library_path_does_not_exist)
819     set(INTROSPECTION_ADDITIONAL_LIBRARY_PATH
820         "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
821     )
822 else ()
823     set(INTROSPECTION_ADDITIONAL_LIBRARY_PATH
824         "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{LD_LIBRARY_PATH}"
825     )
826 endif ()
827
828 # Add required -L flags from ${CMAKE_SHARED_LINKER_FLAGS} for g-ir-scanner
829 string(REGEX MATCHALL "-L[^ ]*"
830     INTROSPECTION_ADDITIONAL_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
831
832 add_custom_command(
833     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
834     DEPENDS WebKit2
835     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
836     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
837         LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
838         ${INTROSPECTION_SCANNER}
839         --quiet
840         --warn-all
841         --symbol-prefix=webkit
842         --identifier-prefix=WebKit
843         --namespace=WebKit2
844         --nsversion=${WEBKITGTK_API_VERSION}
845         --include=GObject-2.0
846         --include=Gtk-3.0
847         --include=Soup-2.4
848         --include-uninstalled=${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
849         --library=webkit2gtk-${WEBKITGTK_API_VERSION}
850         --library=javascriptcoregtk-${WEBKITGTK_API_VERSION}
851         -L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
852         ${INTROSPECTION_ADDITIONAL_LINKER_FLAGS}
853         --no-libtool
854         --pkg=gobject-2.0
855         --pkg=gtk+-3.0
856         --pkg=libsoup-2.4
857         --pkg-export=webkit2gtk-${WEBKITGTK_API_VERSION}
858         --output=${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
859         --c-include="webkit2/webkit2.h"
860         -DBUILDING_WEBKIT
861         -DWEBKIT2_COMPILATION
862         -I${CMAKE_SOURCE_DIR}/Source
863         -I${WEBKIT2_DIR}
864         -I${JAVASCRIPTCORE_DIR}/ForwardingHeaders
865         -I${DERIVED_SOURCES_DIR}
866         -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}
867         -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
868         ${WebKit2GTK_INSTALLED_HEADERS}
869         ${WEBKIT2_DIR}/UIProcess/API/gtk/*.cpp
870 )
871
872 add_custom_command(
873     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
874     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
875     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
876     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
877         LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
878         ${INTROSPECTION_SCANNER}
879         --quiet
880         --warn-all
881         --symbol-prefix=webkit
882         --identifier-prefix=WebKit
883         --namespace=WebKit2WebExtension
884         --nsversion=${WEBKITGTK_API_VERSION}
885         --include=GObject-2.0
886         --include=Gtk-3.0
887         --include=Soup-2.4
888         --include-uninstalled=${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
889         --library=webkit2gtk-${WEBKITGTK_API_VERSION}
890         --library=javascriptcoregtk-${WEBKITGTK_API_VERSION}
891         -L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
892         ${INTROSPECTION_ADDITIONAL_LINKER_FLAGS}
893         --no-libtool
894         --pkg=gobject-2.0
895         --pkg=gtk+-3.0
896         --pkg=libsoup-2.4
897         --pkg-export=webkit2gtk-web-extension-${WEBKITGTK_API_VERSION}
898         --output=${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
899         --c-include="webkit2/webkit-web-extension.h"
900         -DBUILDING_WEBKIT
901         -DWEBKIT2_COMPILATION
902         -I${CMAKE_SOURCE_DIR}/Source
903         -I${WEBKIT2_DIR}
904         -I${JAVASCRIPTCORE_DIR}/ForwardingHeaders
905         -I${DERIVED_SOURCES_DIR}
906         -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}
907         -I${FORWARDING_HEADERS_DIR}
908         -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
909         -I${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}
910         -I${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk
911         ${GObjectDOMBindings_GIR_HEADERS}
912         ${WebKit2WebExtension_INSTALLED_HEADERS}
913         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h
914         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h
915         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.h
916         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
917         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIRequest.h
918         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIResponse.h
919         ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/*.cpp
920 )
921
922 add_custom_command(
923     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
924     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
925     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
926 )
927
928 add_custom_command(
929     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
930     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
931     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
932 )
933
934 ADD_TYPELIB(${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib)
935 ADD_TYPELIB(${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib)
936
937 install(TARGETS webkit2gtkinjectedbundle
938         DESTINATION "${LIB_INSTALL_DIR}/webkit2gtk-${WEBKITGTK_API_VERSION}/injected-bundle"
939 )
940 install(FILES "${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-${WEBKITGTK_API_VERSION}.pc"
941               "${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-web-extension-${WEBKITGTK_API_VERSION}.pc"
942         DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
943 )
944 install(FILES ${WebKit2GTK_INSTALLED_HEADERS}
945               ${WebKit2WebExtension_INSTALLED_HEADERS}
946         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkit2"
947 )
948
949 if (ENABLE_INTROSPECTION)
950     install(FILES ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
951                   ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
952             DESTINATION ${INTROSPECTION_INSTALL_GIRDIR}
953     )
954     install(FILES ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
955                   ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
956             DESTINATION ${INTROSPECTION_INSTALL_TYPELIBDIR}
957     )
958 endif ()
959
960 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkit2gtk.cfg
961     "[webkit2gtk-${WEBKITGTK_API_VERSION}]\n"
962     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
963     "namespace=webkit\n"
964     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
965     "       -I${WEBKIT2_DIR}/UIProcess/API/gtk\n"
966     "       -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}\n"
967     "       -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}\n"
968     "doc_dir=${WEBKIT2_DIR}/UIProcess/API/gtk/docs\n"
969     "source_dirs=${WEBKIT2_DIR}/UIProcess/API/gtk\n"
970     "            ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk\n"
971     "            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}\n"
972     "headers=${WebKit2GTK_ENUM_GENERATION_HEADERS} ${WebKit2WebExtension_INSTALLED_HEADERS}\n"
973     "main_sgml_file=webkit2gtk-docs.sgml\n"
974 )
975
976 add_custom_target(WebKit2-forwarding-headers
977     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT2_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
978 )
979
980 # These symbolic link allows includes like #include <webkit2/WebkitWebView.h> which simulates installed headers.
981 add_custom_command(
982     OUTPUT ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
983     DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk
984     COMMAND ln -n -s -f ${WEBKIT2_DIR}/UIProcess/API/gtk ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
985 )
986 add_custom_command(
987     OUTPUT ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
988     DEPENDS ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk
989     COMMAND ln -n -s -f ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
990 )
991 add_custom_target(WebKit2-fake-api-headers
992     DEPENDS ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
993             ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
994 )
995
996 set(WEBKIT2_EXTRA_DEPENDENCIES
997      WebKit2-forwarding-headers
998      WebKit2-fake-api-headers
999 )