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