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