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