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