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