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