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