[GTK] [CMake] Add support for building WebKit2
[WebKit-https.git] / Source / WebKit2 / PlatformGTK.cmake
1 set(WebProcess_EXECUTABLE_NAME WebKitWebProcess)
2 set(DERIVED_SOURCES_WEBKIT2GTK_DIR ${DERIVED_SOURCES_DIR}/webkit2gtk)
3 set(WEBKIT2_BUILT_API_DIR ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/webkit2)
4 set(WEBKIT2_FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders/webkit2gtk)
5
6 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT2_DIR})
7 file(MAKE_DIRECTORY ${WEBKIT2_BUILT_API_DIR})
8 file(MAKE_DIRECTORY ${WEBKIT2_FORWARDING_HEADERS_DIR})
9
10 configure_file(UIProcess/API/gtk/WebKitVersion.h.in ${WEBKIT2_BUILT_API_DIR}/WebKitVersion.h)
11
12 add_definitions(-DWEBKIT2_COMPILATION)
13 add_definitions(-DLIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}")
14 add_definitions(-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
15 add_definitions(-DLIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}")
16
17 list(APPEND WebKit2_SOURCES
18     ${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.cpp
19     ${WEBKIT2_BUILT_API_DIR}/WebKitEnumTypes.cpp
20     Platform/gtk/LoggingGtk.cpp
21     Platform/gtk/ModuleGtk.cpp
22     Platform/gtk/WorkQueueGtk.cpp
23     Platform/unix/SharedMemoryUnix.cpp
24     WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
25     WebProcess/WebPage/gtk/WebPageGtk.cpp
26     WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
27     WebProcess/WebPage/gtk/WebInspectorGtk.cpp
28     WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp
29     WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp
30     WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp
31     WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp
32     WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
33     WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp
34     UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp
35     UIProcess/API/C/gtk/WKInspectorClientGtk.cpp
36     UIProcess/gtk/WebContextMenuProxyGtk.cpp
37     UIProcess/gtk/WebContextGtk.cpp
38     UIProcess/gtk/WebPageProxyGtk.cpp
39     UIProcess/gtk/WebPreferencesGtk.cpp
40     UIProcess/gtk/WebFullScreenClientGtk.cpp
41     UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp
42     UIProcess/gtk/WebInspectorProxyGtk.cpp
43     UIProcess/gtk/TextCheckerGtk.cpp
44     UIProcess/gtk/WebPopupMenuProxyGtk.cpp
45     UIProcess/gtk/WebInspectorClientGtk.cpp
46     UIProcess/gtk/WebProcessProxyGtk.cpp
47     UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
48     UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
49
50     Shared/API/c/gtk/WKGraphicsContextGtk.cpp
51     Shared/Downloads/gtk/DownloadSoupErrorsGtk.cpp
52     Shared/gtk/ArgumentCodersGtk.cpp
53     Shared/gtk/LayerTreeContextGtk.cpp
54     Shared/gtk/NativeWebKeyboardEventGtk.cpp
55     Shared/gtk/NativeWebMouseEventGtk.cpp
56     Shared/gtk/NativeWebWheelEventGtk.cpp
57     Shared/gtk/PrintInfoGtk.cpp
58     Shared/gtk/ProcessExecutablePathGtk.cpp
59     Shared/gtk/WebEventFactory.cpp
60
61     Platform/CoreIPC/unix/ConnectionUnix.cpp
62     Platform/CoreIPC/unix/AttachmentUnix.cpp
63     PluginProcess/unix/PluginControllerProxyUnix.cpp
64     PluginProcess/unix/PluginProcessMainUnix.cpp
65     PluginProcess/unix/PluginProcessUnix.cpp
66     Shared/API/c/cairo/WKImageCairo.cpp
67     Shared/Downloads/soup/DownloadSoup.cpp
68     Shared/cairo/ShareableBitmapCairo.cpp
69     Shared/linux/SeccompFilters/OpenSyscall.cpp
70     Shared/linux/SeccompFilters/SigactionSyscall.cpp
71     Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp
72     Shared/linux/SeccompFilters/SeccompBroker.cpp
73     Shared/linux/SeccompFilters/SeccompFilters.cpp
74     Shared/linux/SeccompFilters/Syscall.cpp
75     Shared/linux/SeccompFilters/SyscallPolicy.cpp
76     Shared/linux/WebMemorySamplerLinux.cpp
77     Shared/soup/PlatformCertificateInfo.cpp
78     Shared/soup/WebCoreArgumentCodersSoup.cpp
79     UIProcess/DefaultUndoController.cpp
80     Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
81     UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
82     UIProcess/API/C/CoordinatedGraphics/WKView.cpp
83     UIProcess/API/C/soup/WKContextSoup.cpp
84     UIProcess/API/C/soup/WKCookieManagerSoup.cpp
85     UIProcess/API/C/soup/WKSoupRequestManager.cpp
86     UIProcess/cairo/BackingStoreCairo.cpp
87     UIProcess/CoordinatedGraphics/WebView.cpp
88     UIProcess/CoordinatedGraphics/WebViewClient.cpp
89     UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp
90     UIProcess/soup/WebCookieManagerProxySoup.cpp
91     UIProcess/soup/WebSoupRequestManagerClient.cpp
92     UIProcess/soup/WebSoupRequestManagerProxy.cpp
93     UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
94     UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
95     UIProcess/Storage/StorageManager.cpp
96     WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
97     WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp
98     WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp
99     WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
100     WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
101     WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
102     WebProcess/soup/WebProcessSoup.cpp
103     WebProcess/soup/WebSoupRequestManager.cpp
104     WebProcess/soup/WebKitSoupRequestGeneric.cpp
105     WebProcess/soup/WebKitSoupRequestInputStream.cpp
106
107     UIProcess/API/gtk/PageClientImpl.cpp
108     UIProcess/API/gtk/PageClientImpl.h
109     UIProcess/API/gtk/webkit2.h
110     UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
111     UIProcess/API/gtk/WebKitAuthenticationDialog.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/WebKitContextMenuActions.cpp
118     UIProcess/API/gtk/WebKitContextMenuActions.h
119     UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h
120     UIProcess/API/gtk/WebKitContextMenuClient.cpp
121     UIProcess/API/gtk/WebKitContextMenuClient.h
122     UIProcess/API/gtk/WebKitContextMenu.cpp
123     UIProcess/API/gtk/WebKitContextMenu.h
124     UIProcess/API/gtk/WebKitContextMenuItem.cpp
125     UIProcess/API/gtk/WebKitContextMenuItem.h
126     UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
127     UIProcess/API/gtk/WebKitContextMenuPrivate.h
128     UIProcess/API/gtk/WebKitCookieManager.cpp
129     UIProcess/API/gtk/WebKitCookieManager.h
130     UIProcess/API/gtk/WebKitCookieManagerPrivate.h
131     UIProcess/API/gtk/WebKitDefines.h
132     UIProcess/API/gtk/WebKitDownloadClient.cpp
133     UIProcess/API/gtk/WebKitDownloadClient.h
134     UIProcess/API/gtk/WebKitDownload.cpp
135     UIProcess/API/gtk/WebKitDownload.h
136     UIProcess/API/gtk/WebKitDownloadPrivate.h
137     UIProcess/API/gtk/WebKitEditingCommands.h
138     UIProcess/API/gtk/WebKitError.cpp
139     UIProcess/API/gtk/WebKitError.h
140     UIProcess/API/gtk/WebKitFaviconDatabase.cpp
141     UIProcess/API/gtk/WebKitFaviconDatabase.h
142     UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h
143     UIProcess/API/gtk/WebKitFileChooserRequest.cpp
144     UIProcess/API/gtk/WebKitFileChooserRequest.h
145     UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h
146     UIProcess/API/gtk/WebKitFindController.cpp
147     UIProcess/API/gtk/WebKitFindController.h
148     UIProcess/API/gtk/WebKitFormClient.cpp
149     UIProcess/API/gtk/WebKitFormClient.h
150     UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp
151     UIProcess/API/gtk/WebKitFormSubmissionRequest.h
152     UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h
153     UIProcess/API/gtk/WebKitForwardDeclarations.h
154     UIProcess/API/gtk/WebKitFullscreenClient.cpp
155     UIProcess/API/gtk/WebKitFullscreenClient.h
156     UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp
157     UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
158     UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h
159     UIProcess/API/gtk/WebKitGeolocationProvider.cpp
160     UIProcess/API/gtk/WebKitGeolocationProvider.h
161     UIProcess/API/gtk/WebKitHitTestResult.cpp
162     UIProcess/API/gtk/WebKitHitTestResult.h
163     UIProcess/API/gtk/WebKitHitTestResultPrivate.h
164     UIProcess/API/gtk/WebKitInjectedBundleClient.cpp
165     UIProcess/API/gtk/WebKitInjectedBundleClient.h
166     UIProcess/API/gtk/WebKitJavascriptResult.cpp
167     UIProcess/API/gtk/WebKitJavascriptResult.h
168     UIProcess/API/gtk/WebKitJavascriptResultPrivate.h
169     UIProcess/API/gtk/WebKitLoaderClient.cpp
170     UIProcess/API/gtk/WebKitLoaderClient.h
171     UIProcess/API/gtk/WebKitMimeInfo.cpp
172     UIProcess/API/gtk/WebKitMimeInfo.h
173     UIProcess/API/gtk/WebKitMimeInfoPrivate.h
174     UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
175     UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
176     UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
177     UIProcess/API/gtk/WebKitPermissionRequest.cpp
178     UIProcess/API/gtk/WebKitPermissionRequest.h
179     UIProcess/API/gtk/WebKitPlugin.cpp
180     UIProcess/API/gtk/WebKitPlugin.h
181     UIProcess/API/gtk/WebKitPluginPrivate.h
182     UIProcess/API/gtk/WebKitPolicyClient.cpp
183     UIProcess/API/gtk/WebKitPolicyClient.h
184     UIProcess/API/gtk/WebKitPolicyDecision.cpp
185     UIProcess/API/gtk/WebKitPolicyDecision.h
186     UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h
187     UIProcess/API/gtk/WebKitPrintOperation.cpp
188     UIProcess/API/gtk/WebKitPrintOperation.h
189     UIProcess/API/gtk/WebKitPrintOperationPrivate.h
190     UIProcess/API/gtk/WebKitPrivate.cpp
191     UIProcess/API/gtk/WebKitPrivate.h
192     UIProcess/API/gtk/WebKitRequestManagerClient.cpp
193     UIProcess/API/gtk/WebKitRequestManagerClient.h
194     UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp
195     UIProcess/API/gtk/WebKitResponsePolicyDecision.h
196     UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h
197     UIProcess/API/gtk/WebKitScriptDialog.cpp
198     UIProcess/API/gtk/WebKitScriptDialog.h
199     UIProcess/API/gtk/WebKitScriptDialogPrivate.h
200     UIProcess/API/gtk/WebKitSecurityManager.cpp
201     UIProcess/API/gtk/WebKitSecurityManager.h
202     UIProcess/API/gtk/WebKitSecurityManagerPrivate.h
203     UIProcess/API/gtk/WebKitSettings.cpp
204     UIProcess/API/gtk/WebKitSettings.h
205     UIProcess/API/gtk/WebKitSettingsPrivate.h
206     UIProcess/API/gtk/WebKitTextChecker.cpp
207     UIProcess/API/gtk/WebKitTextChecker.h
208     UIProcess/API/gtk/WebKitUIClient.cpp
209     UIProcess/API/gtk/WebKitUIClient.h
210     UIProcess/API/gtk/WebKitURIRequest.cpp
211     UIProcess/API/gtk/WebKitURIRequest.h
212     UIProcess/API/gtk/WebKitURIRequestPrivate.h
213     UIProcess/API/gtk/WebKitURIResponse.cpp
214     UIProcess/API/gtk/WebKitURIResponse.h
215     UIProcess/API/gtk/WebKitURIResponsePrivate.h
216     UIProcess/API/gtk/WebKitURISchemeRequest.cpp
217     UIProcess/API/gtk/WebKitURISchemeRequest.h
218     UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h
219     UIProcess/API/gtk/WebKitVersion.cpp
220     UIProcess/API/gtk/WebKitVersion.h.in
221     UIProcess/API/gtk/WebKitWebContext.cpp
222     UIProcess/API/gtk/WebKitWebContext.h
223     UIProcess/API/gtk/WebKitWebContextPrivate.h
224     UIProcess/API/gtk/WebKitWebInspector.cpp
225     UIProcess/API/gtk/WebKitWebInspector.h
226     UIProcess/API/gtk/WebKitWebInspectorPrivate.h
227     UIProcess/API/gtk/WebKitWebResource.cpp
228     UIProcess/API/gtk/WebKitWebResource.h
229     UIProcess/API/gtk/WebKitWebResourcePrivate.h
230     UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp
231     UIProcess/API/gtk/WebKitWebViewBaseAccessible.h
232     UIProcess/API/gtk/WebKitWebViewBase.cpp
233     UIProcess/API/gtk/WebKitWebViewBase.h
234     UIProcess/API/gtk/WebKitWebViewBasePrivate.h
235     UIProcess/API/gtk/WebKitWebView.cpp
236     UIProcess/API/gtk/WebKitWebViewGroup.cpp
237     UIProcess/API/gtk/WebKitWebViewGroup.h
238     UIProcess/API/gtk/WebKitWebViewGroupPrivate.h
239     UIProcess/API/gtk/WebKitWebView.h
240     UIProcess/API/gtk/WebKitWebViewPrivate.h
241     UIProcess/API/gtk/WebKitWindowProperties.cpp
242     UIProcess/API/gtk/WebKitWindowProperties.h
243     UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h
244     UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp
245     UIProcess/API/gtk/WebViewBaseInputMethodFilter.h
246
247     UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp
248     UIProcess/API/C/gtk/WKInspectorClientGtk.cpp
249     UIProcess/API/C/gtk/WKView.cpp
250
251     WebProcess/gtk/WebProcessMainGtk.cpp
252 )
253
254 set(WebKit2_INSTALLED_HEADERS
255     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardList.h
256     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardListItem.h
257     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h
258     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h
259     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.h
260     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCookieManager.h
261     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitDefines.h
262     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitDownload.h
263     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEditingCommands.h
264     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitError.h
265     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFaviconDatabase.h
266     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFileChooserRequest.h
267     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFindController.h
268     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFormSubmissionRequest.h
269     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitForwardDeclarations.h
270     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
271     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
272     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitJavascriptResult.h
273     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitMimeInfo.h
274     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
275     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPermissionRequest.h
276     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPlugin.h
277     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPolicyDecision.h
278     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPrintOperation.h
279     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitResponsePolicyDecision.h
280     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitScriptDialog.h
281     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitSecurityManager.h
282     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitSettings.h
283     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIRequest.h
284     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIResponse.h
285     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURISchemeRequest.h
286     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebContext.h
287     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebInspector.h
288     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebResource.h
289     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebView.h
290     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebViewBase.h
291     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebViewGroup.h
292     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWindowProperties.h
293     ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2.h
294
295     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h
296     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h
297     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h
298 )
299
300 list(APPEND WebKit2_MESSAGES_IN_FILES
301     UIProcess/soup/WebSoupRequestManagerProxy.messages.in
302     WebProcess/soup/WebSoupRequestManager.messages.in
303 )
304
305 # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
306 list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
307     "${WEBKIT2_FORWARDING_HEADERS_DIR}"
308     "${WEBKIT2_BUILT_API_DIR}"
309     "${DERIVED_SOURCES_WEBKIT2GTK_DIR}"
310 )
311
312 list(APPEND WebKit2_INCLUDE_DIRECTORIES
313     "${WEBCORE_DIR}/platform/gtk"
314     "${WEBCORE_DIR}/platform/graphics/cairo"
315     "${WEBCORE_DIR}/platform/network/soup"
316     "${WEBCORE_DIR}/platform/text/enchant"
317     "${WEBKIT2_DIR}/Shared/API/c/gtk"
318     "${WEBKIT2_DIR}/Shared/Downloads/soup"
319     "${WEBKIT2_DIR}/Shared/gtk"
320     "${WEBKIT2_DIR}/Shared/soup"
321     "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
322     "${WEBKIT2_DIR}/UIProcess/API/C/gtk"
323     "${WEBKIT2_DIR}/UIProcess/API/C/soup"
324     "${WEBKIT2_DIR}/UIProcess/API/cpp/gtk"
325     "${WEBKIT2_DIR}/UIProcess/API/gtk"
326     "${WEBKIT2_DIR}/UIProcess/gtk"
327     "${WEBKIT2_DIR}/UIProcess/soup"
328     "${WEBKIT2_DIR}/WebProcess/gtk"
329     "${WEBKIT2_DIR}/WebProcess/soup"
330     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/gtk"
331     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/soup"
332     "${WEBKIT2_DIR}/WebProcess/WebPage/atk"
333     "${WEBKIT2_DIR}/WebProcess/WebPage/gtk"
334     "${WTF_DIR}/wtf/gtk/"
335     "${WTF_DIR}/wtf/gobject"
336     ${WTF_DIR}
337     ${CAIRO_INCLUDE_DIRS}
338     ${ENCHANT_INCLUDE_DIRS}
339     ${GLIB_INCLUDE_DIRS}
340     ${GTK3_INCLUDE_DIRS}
341     ${LIBSOUP_INCLUDE_DIRS}
342 )
343
344 list(APPEND WebProcess_SOURCES
345     gtk/MainGtk.cpp
346 )
347
348 set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
349 add_custom_command(
350     OUTPUT ${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.cpp
351            ${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.h
352     MAIN_DEPENDENCY ${WebKit2_MARSHAL_LIST}
353
354     COMMAND echo extern \"C\" { > ${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.cpp
355     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --body >> ${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.cpp
356     COMMAND echo } >> ${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.cpp
357
358     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --header > ${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.h
359     VERBATIM)
360
361 add_custom_command(
362     OUTPUT ${WEBKIT2_BUILT_API_DIR}/WebKitEnumTypes.h
363            ${WEBKIT2_BUILT_API_DIR}/WebKitEnumTypes.cpp
364     DEPENDS ${WebKit2_INSTALLED_HEADERS}
365
366     COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.h.template ${WebKit2_INSTALLED_HEADERS} | sed s/web_kit/webkit/ | sed s/WEBKIT_TYPE_KIT/WEBKIT_TYPE/ > ${WEBKIT2_BUILT_API_DIR}/WebKitEnumTypes.h
367
368     COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.cpp.template ${WebKit2_INSTALLED_HEADERS} | sed s/web_kit/webkit/ > ${WEBKIT2_BUILT_API_DIR}/WebKitEnumTypes.cpp
369     VERBATIM)
370
371 # This symbolic link allows includes like #include <webkit2/WebkitWebView.h> which simulates installed headers.
372 add_custom_target(fake-installed-headers
373     mkdir -p ${DERIVED_SOURCES_WEBKIT2_DIR}/webkit2gtk/include
374     COMMAND ln -n -s -f ${WEBKIT2_DIR}/UIProcess/API/gtk ${WEBKIT2_FORWARDING_HEADERS_DIR}/webkit2
375 )
376
377 add_custom_target(gtk-forwarding-headers
378     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include gtk
379 )
380
381 add_custom_target(soup-forwarding-headers
382     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include soup
383 )
384
385 set(WEBKIT2_EXTRA_DEPENDENCIES
386      gtk-forwarding-headers
387      soup-forwarding-headers
388      fake-installed-headers
389 )
390
391 if (ENABLE_PLUGIN_PROCESS)
392     add_definitions(-DENABLE_PLUGIN_PROCESS=1)
393
394     set(PluginProcess_EXECUTABLE_NAME WebKitPluginProcess)
395     list(APPEND PluginProcess_INCLUDE_DIRECTORIES
396         "${WEBKIT2_DIR}/PluginProcess/unix"
397     )
398
399     include_directories(${PluginProcess_INCLUDE_DIRECTORIES})
400
401     list(APPEND PluginProcess_SOURCES
402         ${WEBKIT2_DIR}/unix/PluginMainUnix.cpp
403     )
404
405     set(PluginProcess_LIBRARIES ${WebKit2_LIBRARY_NAME})
406
407     add_executable(${PluginProcess_EXECUTABLE_NAME} ${PluginProcess_SOURCES})
408     target_link_libraries(${PluginProcess_EXECUTABLE_NAME} ${PluginProcess_LIBRARIES})
409     install(TARGETS ${PluginProcess_EXECUTABLE_NAME} DESTINATION "${EXEC_INSTALL_DIR}")
410 endif () # ENABLE_PLUGIN_PROCESS