[GTK] URTBF after r184503.
[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 file(GLOB 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 )
430
431 # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
432 # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
433 add_custom_command(
434     OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
435     DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
436     COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
437 )
438
439 list(APPEND InspectorFiles
440     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
441     ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
442 )
443
444 # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
445 list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
446     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
447     "${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}"
448     "${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}"
449     "${DERIVED_SOURCES_WEBKIT2GTK_DIR}"
450 )
451
452 list(APPEND WebKit2_INCLUDE_DIRECTORIES
453     "${WEBKIT2_DIR}/PluginProcess/unix"
454     "${WEBCORE_DIR}/platform/cairo"
455     "${WEBCORE_DIR}/platform/gtk"
456     "${WEBCORE_DIR}/platform/graphics/cairo"
457     "${WEBCORE_DIR}/platform/graphics/opentype"
458     "${WEBCORE_DIR}/platform/graphics/x11"
459     "${WEBCORE_DIR}/platform/network/soup"
460     "${WEBCORE_DIR}/platform/text/enchant"
461     "${WEBKIT2_DIR}/DatabaseProcess/unix"
462     "${WEBKIT2_DIR}/NetworkProcess/gtk"
463     "${WEBKIT2_DIR}/NetworkProcess/unix"
464     "${WEBKIT2_DIR}/Shared/API/c/gtk"
465     "${WEBKIT2_DIR}/Shared/Network/CustomProtocols/soup"
466     "${WEBKIT2_DIR}/Shared/Downloads/soup"
467     "${WEBKIT2_DIR}/Shared/gtk"
468     "${WEBKIT2_DIR}/Shared/soup"
469     "${WEBKIT2_DIR}/Shared/unix"
470     "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
471     "${WEBKIT2_DIR}/UIProcess/API/C/gtk"
472     "${WEBKIT2_DIR}/UIProcess/API/C/soup"
473     "${WEBKIT2_DIR}/UIProcess/API/cpp/gtk"
474     "${WEBKIT2_DIR}/UIProcess/API/gtk"
475     "${WEBKIT2_DIR}/UIProcess/Network/CustomProtocols/soup"
476     "${WEBKIT2_DIR}/UIProcess/Plugins/gtk"
477     "${WEBKIT2_DIR}/UIProcess/gtk"
478     "${WEBKIT2_DIR}/UIProcess/soup"
479     "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk"
480     "${WEBKIT2_DIR}/WebProcess/gtk"
481     "${WEBKIT2_DIR}/WebProcess/soup"
482     "${WEBKIT2_DIR}/WebProcess/unix"
483     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/gtk"
484     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/soup"
485     "${WEBKIT2_DIR}/WebProcess/WebPage/atk"
486     "${WEBKIT2_DIR}/WebProcess/WebPage/gtk"
487     "${WTF_DIR}/wtf/gtk/"
488     "${WTF_DIR}/wtf/gobject"
489     ${WTF_DIR}
490     ${CAIRO_INCLUDE_DIRS}
491     ${ENCHANT_INCLUDE_DIRS}
492     ${GEOCLUE_INCLUDE_DIRS}
493     ${HARFBUZZ_INCLUDE_DIRS}
494     ${LIBSOUP_INCLUDE_DIRS}
495 )
496
497 if (USE_LIBNOTIFY)
498 list(APPEND WebKit2_INCLUDE_DIRECTORIES
499     ${LIBNOTIFY_INCLUDE_DIRS}
500 )
501 endif ()
502
503 set(WebKit2CommonIncludeDirectories ${WebKit2_INCLUDE_DIRECTORIES})
504
505 list(APPEND WebKit2_INCLUDE_DIRECTORIES
506     ${GLIB_INCLUDE_DIRS}
507     ${GTK_INCLUDE_DIRS}
508     ${GTK_UNIX_PRINT_INCLUDE_DIRS}
509 )
510
511 list(APPEND WebProcess_SOURCES
512     WebProcess/EntryPoint/unix/WebProcessMain.cpp
513 )
514
515 list(APPEND NetworkProcess_SOURCES
516     NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp
517 )
518
519 list(APPEND DatabaseProcess_SOURCES
520     DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp
521 )
522
523 file(WRITE ${CMAKE_BINARY_DIR}/test_atomic.cpp
524      "#include <atomic>\n"
525      "int main() { std::atomic<int64_t> i(0); i++; return 0; }\n")
526 try_compile(ATOMIC_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomic.cpp)
527 if (NOT ATOMIC_BUILD_SUCCEEDED)
528     list(APPEND WebKit2_LIBRARIES atomic)
529 endif ()
530 file(REMOVE ${CMAKE_BINARY_DIR}/test_atomic.cpp)
531
532 set(SharedWebKit2Libraries
533     ${WebKit2_LIBRARIES}
534 )
535
536 list(APPEND WebKit2_LIBRARIES
537     GObjectDOMBindings
538     WebCorePlatformGTK
539     ${GTK_UNIX_PRINT_LIBRARIES}
540 )
541
542 if (LIBNOTIFY_FOUND)
543 list(APPEND WebKit2_LIBRARIES
544     ${LIBNOTIFY_LIBRARIES}
545 )
546 endif ()
547
548 ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
549
550 set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
551 add_custom_command(
552     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
553            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.h
554     MAIN_DEPENDENCY ${WebKit2_MARSHAL_LIST}
555
556     COMMAND echo extern \"C\" { > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
557     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --body >> ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
558     COMMAND echo } >> ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
559
560     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --header > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.h
561     VERBATIM)
562
563 # To generate WebKitEnumTypes.h we want to use all installed headers, except WebKitEnumTypes.h itself.
564 set(WebKit2GTK_ENUM_GENERATION_HEADERS ${WebKit2GTK_INSTALLED_HEADERS})
565 list(REMOVE_ITEM WebKit2GTK_ENUM_GENERATION_HEADERS ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h)
566 add_custom_command(
567     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
568            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
569     DEPENDS ${WebKit2GTK_ENUM_GENERATION_HEADERS}
570
571     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
572
573     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
574     VERBATIM)
575
576 add_custom_command(
577     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
578     DEPENDS ${InspectorFiles}
579             ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
580     COMMAND ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles}
581     VERBATIM
582 )
583
584 add_custom_command(
585     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
586     DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
587     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
588     VERBATIM
589 )
590
591 add_custom_command(
592     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
593     DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
594             ${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
595     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
596     VERBATIM
597 )
598
599 set(WebKit2Resources
600     "        <file alias=\"images/missingImage\">missingImage.png</file>\n"
601     "        <file alias=\"images/missingImage@2x\">missingImage@2x.png</file>\n"
602     "        <file alias=\"images/panIcon\">panIcon.png</file>\n"
603     "        <file alias=\"images/textAreaResizeCorner\">textAreaResizeCorner.png</file>\n"
604     "        <file alias=\"images/textAreaResizeCorner@2x\">textAreaResizeCorner@2x.png</file>\n"
605 )
606
607 if (ENABLE_ICONDATABASE)
608     list(APPEND WebKit2Resources
609         "        <file alias=\"images/urlIcon\">urlIcon.png</file>\n"
610     )
611 endif ()
612
613 if (ENABLE_WEB_AUDIO)
614     list(APPEND WebKit2Resources
615         "        <file alias=\"audio/Composite\">Composite.wav</file>\n"
616     )
617 endif ()
618
619 file(WRITE ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
620     "<?xml version=1.0 encoding=UTF-8?>\n"
621     "<gresources>\n"
622     "    <gresource prefix=\"/org/webkitgtk/resources\">\n"
623     ${WebKit2Resources}
624     "    </gresource>\n"
625     "</gresources>\n"
626 )
627
628 add_custom_command(
629     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c
630     DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
631     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
632     VERBATIM
633 )
634
635 if (ENABLE_PLUGIN_PROCESS_GTK2)
636     set(PluginProcessGTK2_EXECUTABLE_NAME WebKitPluginProcess2)
637
638     # FIXME: We should figure out a way to avoid compiling files that are common between the plugin
639     # process and WebKit2 only once instead of recompiling them for the plugin process.
640     list(APPEND PluginProcessGTK2_SOURCES
641         Platform/Logging.cpp
642         Platform/Module.cpp
643
644         Platform/IPC/ArgumentCoders.cpp
645         Platform/IPC/ArgumentDecoder.cpp
646         Platform/IPC/ArgumentEncoder.cpp
647         Platform/IPC/Attachment.cpp
648         Platform/IPC/Connection.cpp
649         Platform/IPC/DataReference.cpp
650         Platform/IPC/MessageDecoder.cpp
651         Platform/IPC/MessageEncoder.cpp
652         Platform/IPC/MessageReceiverMap.cpp
653         Platform/IPC/MessageSender.cpp
654         Platform/IPC/StringReference.cpp
655
656         Platform/IPC/unix/AttachmentUnix.cpp
657         Platform/IPC/unix/ConnectionUnix.cpp
658
659         Platform/gtk/LoggingGtk.cpp
660         Platform/gtk/ModuleGtk.cpp
661
662         Platform/unix/SharedMemoryUnix.cpp
663
664         PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
665
666         PluginProcess/PluginControllerProxy.cpp
667         PluginProcess/PluginCreationParameters.cpp
668         PluginProcess/PluginProcess.cpp
669         PluginProcess/WebProcessConnection.cpp
670
671         PluginProcess/unix/PluginControllerProxyUnix.cpp
672         PluginProcess/unix/PluginProcessMainUnix.cpp
673         PluginProcess/unix/PluginProcessUnix.cpp
674
675         Shared/ActivityAssertion.cpp
676         Shared/BlobDataFileReferenceWithSandboxExtension.cpp
677         Shared/ChildProcess.cpp
678         Shared/ChildProcessProxy.cpp
679         Shared/ConnectionStack.cpp
680         Shared/ShareableBitmap.cpp
681         Shared/WebCoreArgumentCoders.cpp
682         Shared/WebEvent.cpp
683         Shared/WebKeyboardEvent.cpp
684         Shared/WebKit2Initialize.cpp
685         Shared/WebMouseEvent.cpp
686         Shared/WebPlatformTouchPoint.cpp
687         Shared/WebTouchEvent.cpp
688         Shared/WebWheelEvent.cpp
689
690         Shared/Plugins/NPIdentifierData.cpp
691         Shared/Plugins/NPObjectMessageReceiver.cpp
692         Shared/Plugins/NPObjectProxy.cpp
693         Shared/Plugins/NPRemoteObjectMap.cpp
694         Shared/Plugins/NPVariantData.cpp
695         Shared/Plugins/PluginProcessCreationParameters.cpp
696
697         Shared/Plugins/Netscape/NetscapePluginModule.cpp
698         Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp
699
700         Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
701
702         Shared/cairo/ShareableBitmapCairo.cpp
703
704         Shared/gtk/NativeWebKeyboardEventGtk.cpp
705         Shared/gtk/NativeWebMouseEventGtk.cpp
706         Shared/gtk/NativeWebTouchEventGtk.cpp
707         Shared/gtk/NativeWebWheelEventGtk.cpp
708         Shared/gtk/ProcessExecutablePathGtk.cpp
709         Shared/gtk/WebEventFactory.cpp
710
711         Shared/soup/WebCoreArgumentCodersSoup.cpp
712
713         Shared/unix/ChildProcessMain.cpp
714
715         UIProcess/Launcher/ProcessLauncher.cpp
716
717         UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
718
719         UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
720
721         WebProcess/Plugins/Plugin.cpp
722
723         WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp
724         WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
725         WebProcess/Plugins/Netscape/NetscapePlugin.cpp
726         WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
727         WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
728
729         WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
730
731         ${DERIVED_SOURCES_WEBKIT2_DIR}/PluginControllerProxyMessageReceiver.cpp
732         ${DERIVED_SOURCES_WEBKIT2_DIR}/PluginProcessMessageReceiver.cpp
733         ${DERIVED_SOURCES_WEBKIT2_DIR}/WebProcessConnectionMessageReceiver.cpp
734         ${DERIVED_SOURCES_WEBKIT2_DIR}/NPObjectMessageReceiverMessageReceiver.cpp
735         ${DERIVED_SOURCES_WEBKIT2_DIR}/ChildProcessMessageReceiver.cpp
736     )
737
738     add_executable(WebKitPluginProcess2 ${PluginProcessGTK2_SOURCES})
739     add_webkit2_prefix_header(WebKitPluginProcess2)
740
741     # We need ENABLE_PLUGIN_PROCESS for all targets in this directory, but
742     # we only want GTK_API_VERSION_2 for the plugin process target.
743     set_property(
744         TARGET WebKitPluginProcess2
745         APPEND
746         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
747     )
748     set_property(
749         TARGET WebKitPluginProcess2
750         APPEND
751         PROPERTY INCLUDE_DIRECTORIES
752             ${WebKit2CommonIncludeDirectories}
753             ${GTK2_INCLUDE_DIRS}
754             ${GDK2_INCLUDE_DIRS}
755     )
756
757     set(WebKitPluginProcess2_LIBRARIES
758         ${SharedWebKit2Libraries}
759         WebCorePlatformGTK2
760     )
761     ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKitPluginProcess2_LIBRARIES)
762     target_link_libraries(WebKitPluginProcess2 ${WebKitPluginProcess2_LIBRARIES})
763
764     add_dependencies(WebKitPluginProcess2 WebKit2)
765
766     install(TARGETS WebKitPluginProcess2 DESTINATION "${LIBEXEC_INSTALL_DIR}")
767 endif () # ENABLE_PLUGIN_PROCESS_GTK2
768
769 # GTK3 PluginProcess
770 list(APPEND PluginProcess_SOURCES
771     PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
772 )
773
774 if (ENABLE_THREADED_COMPOSITOR)
775     list(APPEND WebKit2_SOURCES
776         Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
777         Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
778         Shared/CoordinatedGraphics/SimpleViewportController.cpp
779         Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
780         Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
781         WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
782     )
783     list(APPEND WebKit2_INCLUDE_DIRECTORIES
784         "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
785         "${WEBKIT2_DIR}/Shared/CoordinatedGraphics"
786         "${WEBKIT2_DIR}/Shared/CoordinatedGraphics/threadedcompositor"
787         "${WEBKIT2_DIR}/WebProcess/WebPage/CoordinatedGraphics"
788     )
789 else (ENABLE_THREADED_COMPOSITOR)
790     list(APPEND WebKit2_SOURCES
791         WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
792     )
793 endif ()
794
795 # Commands for building the built-in injected bundle.
796 include_directories(
797     "${WEBKIT2_DIR}/Platform"
798     "${WEBKIT2_DIR}/Shared"
799     "${WEBKIT2_DIR}/Shared/API/c"
800     "${WEBKIT2_DIR}/UIProcess/API/C"
801     "${WEBKIT2_DIR}/WebProcess/InjectedBundle"
802     "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c"
803     "${DERIVED_SOURCES_DIR}"
804     "${DERIVED_SOURCES_DIR}/InjectedBundle"
805     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
806     "${FORWARDING_HEADERS_DIR}"
807     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
808 )
809
810 add_library(webkit2gtkinjectedbundle MODULE "${WEBKIT2_DIR}/WebProcess/gtk/WebGtkInjectedBundleMain.cpp")
811 add_dependencies(webkit2gtkinjectedbundle GObjectDOMBindings)
812 add_webkit2_prefix_header(webkit2gtkinjectedbundle)
813
814 # Add ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} to LD_LIBRARY_PATH
815 string(COMPARE EQUAL "$ENV{LD_LIBRARY_PATH}" "" ld_library_path_not_exist)
816 if (ld_library_path_does_not_exist)
817     set(INTROSPECTION_ADDITIONAL_LIBRARY_PATH
818         "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
819     )
820 else ()
821     set(INTROSPECTION_ADDITIONAL_LIBRARY_PATH
822         "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{LD_LIBRARY_PATH}"
823     )
824 endif ()
825
826 # Add required -L flags from ${CMAKE_SHARED_LINKER_FLAGS} for g-ir-scanner
827 string(REGEX MATCHALL "-L[^ ]*"
828     INTROSPECTION_ADDITIONAL_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
829
830 add_custom_command(
831     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
832     DEPENDS WebKit2
833     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
834     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
835         LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
836         ${INTROSPECTION_SCANNER}
837         --quiet
838         --warn-all
839         --symbol-prefix=webkit
840         --identifier-prefix=WebKit
841         --namespace=WebKit2
842         --nsversion=${WEBKITGTK_API_VERSION}
843         --include=GObject-2.0
844         --include=Gtk-3.0
845         --include=Soup-2.4
846         --include-uninstalled=${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
847         --library=webkit2gtk-${WEBKITGTK_API_VERSION}
848         --library=javascriptcoregtk-${WEBKITGTK_API_VERSION}
849         -L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
850         ${INTROSPECTION_ADDITIONAL_LINKER_FLAGS}
851         --no-libtool
852         --pkg=gobject-2.0
853         --pkg=gtk+-3.0
854         --pkg=libsoup-2.4
855         --pkg-export=webkit2gtk-${WEBKITGTK_API_VERSION}
856         --output=${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
857         --c-include="webkit2/webkit2.h"
858         -DBUILDING_WEBKIT
859         -DWEBKIT2_COMPILATION
860         -I${CMAKE_SOURCE_DIR}/Source
861         -I${WEBKIT2_DIR}
862         -I${JAVASCRIPTCORE_DIR}/ForwardingHeaders
863         -I${DERIVED_SOURCES_DIR}
864         -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}
865         -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
866         ${WebKit2GTK_INSTALLED_HEADERS}
867         ${WEBKIT2_DIR}/UIProcess/API/gtk/*.cpp
868 )
869
870 add_custom_command(
871     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
872     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
873     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
874     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
875         LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
876         ${INTROSPECTION_SCANNER}
877         --quiet
878         --warn-all
879         --symbol-prefix=webkit
880         --identifier-prefix=WebKit
881         --namespace=WebKit2WebExtension
882         --nsversion=${WEBKITGTK_API_VERSION}
883         --include=GObject-2.0
884         --include=Gtk-3.0
885         --include=Soup-2.4
886         --include-uninstalled=${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
887         --library=webkit2gtk-${WEBKITGTK_API_VERSION}
888         --library=javascriptcoregtk-${WEBKITGTK_API_VERSION}
889         -L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
890         ${INTROSPECTION_ADDITIONAL_LINKER_FLAGS}
891         --no-libtool
892         --pkg=gobject-2.0
893         --pkg=gtk+-3.0
894         --pkg=libsoup-2.4
895         --pkg-export=webkit2gtk-web-extension-${WEBKITGTK_API_VERSION}
896         --output=${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
897         --c-include="webkit2/webkit-web-extension.h"
898         -DBUILDING_WEBKIT
899         -DWEBKIT2_COMPILATION
900         -I${CMAKE_SOURCE_DIR}/Source
901         -I${WEBKIT2_DIR}
902         -I${JAVASCRIPTCORE_DIR}/ForwardingHeaders
903         -I${DERIVED_SOURCES_DIR}
904         -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}
905         -I${FORWARDING_HEADERS_DIR}
906         -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
907         -I${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}
908         -I${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk
909         ${GObjectDOMBindings_GIR_HEADERS}
910         ${WebKit2WebExtension_INSTALLED_HEADERS}
911         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h
912         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h
913         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.h
914         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
915         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIRequest.h
916         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIResponse.h
917         ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/*.cpp
918 )
919
920 add_custom_command(
921     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
922     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
923     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
924 )
925
926 add_custom_command(
927     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
928     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
929     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
930 )
931
932 ADD_TYPELIB(${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib)
933 ADD_TYPELIB(${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib)
934
935 install(TARGETS webkit2gtkinjectedbundle
936         DESTINATION "${LIB_INSTALL_DIR}/webkit2gtk-${WEBKITGTK_API_VERSION}/injected-bundle"
937 )
938 install(FILES "${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-${WEBKITGTK_API_VERSION}.pc"
939               "${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-web-extension-${WEBKITGTK_API_VERSION}.pc"
940         DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
941 )
942 install(FILES ${WebKit2GTK_INSTALLED_HEADERS}
943               ${WebKit2WebExtension_INSTALLED_HEADERS}
944         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkit2"
945 )
946
947 if (ENABLE_INTROSPECTION)
948     install(FILES ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
949                   ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
950             DESTINATION ${INTROSPECTION_INSTALL_GIRDIR}
951     )
952     install(FILES ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
953                   ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
954             DESTINATION ${INTROSPECTION_INSTALL_TYPELIBDIR}
955     )
956 endif ()
957
958 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkit2gtk.cfg
959     "[webkit2gtk-${WEBKITGTK_API_VERSION}]\n"
960     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
961     "namespace=webkit\n"
962     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
963     "       -I${WEBKIT2_DIR}/UIProcess/API/gtk\n"
964     "       -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}\n"
965     "       -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}\n"
966     "doc_dir=${WEBKIT2_DIR}/UIProcess/API/gtk/docs\n"
967     "source_dirs=${WEBKIT2_DIR}/UIProcess/API/gtk\n"
968     "            ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk\n"
969     "            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}\n"
970     "headers=${WebKit2GTK_ENUM_GENERATION_HEADERS} ${WebKit2WebExtension_INSTALLED_HEADERS}\n"
971     "main_sgml_file=webkit2gtk-docs.sgml\n"
972 )
973
974 add_custom_target(WebKit2-forwarding-headers
975     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT2_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
976 )
977
978 # These symbolic link allows includes like #include <webkit2/WebkitWebView.h> which simulates installed headers.
979 add_custom_command(
980     OUTPUT ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
981     DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk
982     COMMAND ln -n -s -f ${WEBKIT2_DIR}/UIProcess/API/gtk ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
983 )
984 add_custom_command(
985     OUTPUT ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
986     DEPENDS ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk
987     COMMAND ln -n -s -f ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
988 )
989 add_custom_target(WebKit2-fake-api-headers
990     DEPENDS ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
991             ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
992 )
993
994 set(WEBKIT2_EXTRA_DEPENDENCIES
995      WebKit2-forwarding-headers
996      WebKit2-fake-api-headers
997 )