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