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