3dc88af91ba97dd220d241f9301183350bc1470e
[WebKit-https.git] / Source / WebCore / PlatformGTK.cmake
1 list(APPEND WebCore_INCLUDE_DIRECTORIES
2     "${WEBCORE_DIR}/accessibility/atk"
3     "${WEBCORE_DIR}/editing/atk"
4     "${WEBCORE_DIR}/page/gtk"
5     "${WEBCORE_DIR}/platform/cairo"
6     "${WEBCORE_DIR}/platform/geoclue"
7     "${WEBCORE_DIR}/platform/gtk"
8     "${WEBCORE_DIR}/platform/graphics/cairo"
9     "${WEBCORE_DIR}/platform/graphics/egl"
10     "${WEBCORE_DIR}/platform/graphics/glx"
11     "${WEBCORE_DIR}/platform/graphics/gtk"
12     "${WEBCORE_DIR}/platform/graphics/freetype"
13     "${WEBCORE_DIR}/platform/graphics/harfbuzz/"
14     "${WEBCORE_DIR}/platform/graphics/harfbuzz/ng"
15     "${WEBCORE_DIR}/platform/graphics/opengl"
16     "${WEBCORE_DIR}/platform/graphics/opentype"
17     "${WEBCORE_DIR}/platform/graphics/wayland"
18     "${WEBCORE_DIR}/platform/linux"
19     "${WEBCORE_DIR}/platform/mediastream/gstreamer"
20     "${WEBCORE_DIR}/platform/mock/mediasource"
21     "${WEBCORE_DIR}/platform/network/gtk"
22     "${WEBCORE_DIR}/platform/network/soup"
23     "${WEBCORE_DIR}/platform/text/gtk"
24     "${WEBCORE_DIR}/platform/text/icu"
25 )
26
27 list(APPEND WebCore_SOURCES
28     accessibility/atk/AXObjectCacheAtk.cpp
29     accessibility/atk/AccessibilityObjectAtk.cpp
30     accessibility/atk/WebKitAccessibleHyperlink.cpp
31     accessibility/atk/WebKitAccessibleInterfaceAction.cpp
32     accessibility/atk/WebKitAccessibleInterfaceComponent.cpp
33     accessibility/atk/WebKitAccessibleInterfaceDocument.cpp
34     accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp
35     accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp
36     accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp
37     accessibility/atk/WebKitAccessibleInterfaceImage.cpp
38     accessibility/atk/WebKitAccessibleInterfaceSelection.cpp
39     accessibility/atk/WebKitAccessibleInterfaceTable.cpp
40     accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp
41     accessibility/atk/WebKitAccessibleInterfaceText.cpp
42     accessibility/atk/WebKitAccessibleInterfaceValue.cpp
43     accessibility/atk/WebKitAccessibleUtil.cpp
44     accessibility/atk/WebKitAccessibleWrapperAtk.cpp
45
46     editing/atk/FrameSelectionAtk.cpp
47     editing/SmartReplace.cpp
48
49     loader/soup/CachedRawResourceSoup.cpp
50     loader/soup/SubresourceLoaderSoup.cpp
51
52     platform/Cursor.cpp
53     platform/PlatformStrategies.cpp
54
55     platform/audio/gtk/AudioBusGtk.cpp
56
57     platform/audio/gstreamer/AudioDestinationGStreamer.cpp
58     platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
59     platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
60     platform/audio/gstreamer/FFTFrameGStreamer.cpp
61     platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
62
63     platform/geoclue/GeolocationProviderGeoclue1.cpp
64     platform/geoclue/GeolocationProviderGeoclue2.cpp
65
66     platform/graphics/GraphicsContext3DPrivate.cpp
67     platform/graphics/ImageSource.cpp
68     platform/graphics/WOFFFileFormat.cpp
69
70     platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp
71     platform/graphics/cairo/BackingStoreBackendCairoX11.cpp
72     platform/graphics/cairo/BitmapImageCairo.cpp
73     platform/graphics/cairo/CairoUtilities.cpp
74     platform/graphics/cairo/FloatRectCairo.cpp
75     platform/graphics/cairo/FontCairo.cpp
76     platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
77     platform/graphics/cairo/GradientCairo.cpp
78     platform/graphics/cairo/GraphicsContext3DCairo.cpp
79     platform/graphics/cairo/GraphicsContextCairo.cpp
80     platform/graphics/cairo/ImageBufferCairo.cpp
81     platform/graphics/cairo/ImageCairo.cpp
82     platform/graphics/cairo/IntRectCairo.cpp
83     platform/graphics/cairo/OwnPtrCairo.cpp
84     platform/graphics/cairo/PathCairo.cpp
85     platform/graphics/cairo/PatternCairo.cpp
86     platform/graphics/cairo/PlatformContextCairo.cpp
87     platform/graphics/cairo/PlatformPathCairo.cpp
88     platform/graphics/cairo/RefPtrCairo.cpp
89     platform/graphics/cairo/TransformationMatrixCairo.cpp
90
91     platform/graphics/freetype/FontCacheFreeType.cpp
92     platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
93     platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
94     platform/graphics/freetype/SimpleFontDataFreeType.cpp
95
96     platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp
97     platform/graphics/gstreamer/GRefPtrGStreamer.cpp
98     platform/graphics/gstreamer/GStreamerUtilities.cpp
99     platform/graphics/gstreamer/ImageGStreamerCairo.cpp
100     platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
101     platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
102     platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
103     platform/graphics/gstreamer/MediaSourceGStreamer.cpp
104     platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp
105     platform/graphics/gstreamer/TextCombinerGStreamer.cpp
106     platform/graphics/gstreamer/TextSinkGStreamer.cpp
107     platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
108     platform/graphics/gstreamer/VideoSinkGStreamer.cpp
109     platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
110     platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp
111     platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
112
113     platform/graphics/harfbuzz/HarfBuzzFace.cpp
114     platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
115     platform/graphics/harfbuzz/HarfBuzzShaper.cpp
116
117     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
118     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
119     platform/graphics/opengl/TemporaryOpenGLSetting.cpp
120
121     platform/graphics/opentype/OpenTypeVerticalData.cpp
122
123     platform/gtk/ErrorsGtk.cpp
124     platform/gtk/EventLoopGtk.cpp
125     platform/gtk/FileSystemGtk.cpp
126     platform/gtk/GamepadsGtk.cpp
127     platform/gtk/LanguageGtk.cpp
128     platform/gtk/LoggingGtk.cpp
129     platform/gtk/MIMETypeRegistryGtk.cpp
130     platform/gtk/SharedBufferGtk.cpp
131     platform/gtk/SharedTimerGtk.cpp
132     platform/gtk/TemporaryLinkStubs.cpp
133     platform/gtk/UserAgentGtk.cpp
134
135     platform/image-decoders/ImageDecoder.cpp
136
137     platform/image-decoders/cairo/ImageDecoderCairo.cpp
138
139     platform/image-decoders/gif/GIFImageDecoder.cpp
140     platform/image-decoders/gif/GIFImageReader.cpp
141
142     platform/image-decoders/ico/ICOImageDecoder.cpp
143
144     platform/image-decoders/jpeg/JPEGImageDecoder.cpp
145
146     platform/image-decoders/bmp/BMPImageDecoder.cpp
147     platform/image-decoders/bmp/BMPImageReader.cpp
148
149     platform/image-decoders/png/PNGImageDecoder.cpp
150
151     platform/image-decoders/webp/WEBPImageDecoder.cpp
152
153     platform/linux/GamepadDeviceLinux.cpp
154     platform/linux/MemoryPressureHandlerLinux.cpp
155
156     platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
157
158     platform/network/soup/AuthenticationChallengeSoup.cpp
159     platform/network/soup/CertificateInfo.cpp
160     platform/network/soup/CookieJarSoup.cpp
161     platform/network/soup/CookieStorageSoup.cpp
162     platform/network/soup/CredentialStorageSoup.cpp
163     platform/network/soup/DNSSoup.cpp
164     platform/network/soup/NetworkStorageSessionSoup.cpp
165     platform/network/soup/ProxyServerSoup.cpp
166     platform/network/soup/ResourceErrorSoup.cpp
167     platform/network/soup/ResourceHandleSoup.cpp
168     platform/network/soup/ResourceRequestSoup.cpp
169     platform/network/soup/ResourceResponseSoup.cpp
170     platform/network/soup/SocketStreamHandleSoup.cpp
171     platform/network/soup/SoupNetworkSession.cpp
172     platform/network/soup/SynchronousLoaderClientSoup.cpp
173
174     platform/soup/SharedBufferSoup.cpp
175     platform/soup/URLSoup.cpp
176
177     platform/text/icu/UTextProvider.cpp
178     platform/text/icu/UTextProviderLatin1.cpp
179     platform/text/icu/UTextProviderUTF16.cpp
180     platform/text/LocaleICU.cpp
181     platform/text/TextCodecICU.cpp
182     platform/text/TextEncodingDetectorICU.cpp
183
184     platform/text/enchant/TextCheckerEnchant.cpp
185
186     platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
187
188     platform/network/gtk/CredentialBackingStore.cpp
189 )
190
191 list(APPEND WebCorePlatformGTK_SOURCES
192     editing/gtk/EditorGtk.cpp
193
194     page/gtk/DragControllerGtk.cpp
195     page/gtk/EventHandlerGtk.cpp
196
197     platform/graphics/GLContext.cpp
198
199     platform/graphics/egl/GLContextEGL.cpp
200
201     platform/graphics/freetype/FontPlatformDataFreeType.cpp
202
203     platform/graphics/glx/GLContextGLX.cpp
204
205     platform/graphics/gtk/ColorGtk.cpp
206     platform/graphics/gtk/GdkCairoUtilities.cpp
207     platform/graphics/gtk/IconGtk.cpp
208     platform/graphics/gtk/ImageBufferGtk.cpp
209     platform/graphics/gtk/ImageGtk.cpp
210
211     platform/gtk/ContextMenuGtk.cpp
212     platform/gtk/ContextMenuItemGtk.cpp
213     platform/gtk/CursorGtk.cpp
214     platform/gtk/DataObjectGtk.cpp
215     platform/gtk/DragDataGtk.cpp
216     platform/gtk/DragIcon.cpp
217     platform/gtk/DragImageGtk.cpp
218     platform/gtk/GRefPtrGtk.cpp
219     platform/gtk/GtkUtilities.cpp
220     platform/gtk/GtkVersioning.c
221     platform/gtk/KeyBindingTranslator.cpp
222     platform/gtk/LocalizedStringsGtk.cpp
223     platform/gtk/PasteboardGtk.cpp
224     platform/gtk/PasteboardHelper.cpp
225     platform/gtk/PlatformKeyboardEventGtk.cpp
226     platform/gtk/PlatformMouseEventGtk.cpp
227     platform/gtk/PlatformScreenGtk.cpp
228     platform/gtk/PlatformWheelEventGtk.cpp
229     platform/gtk/ScrollbarThemeGtk.cpp
230     platform/gtk/SoundGtk.cpp
231     platform/gtk/WidgetGtk.cpp
232
233     rendering/RenderThemeGtk.cpp
234 )
235
236 if (WTF_USE_GEOCLUE2)
237     list(APPEND WebCore_SOURCES
238         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
239     )
240     execute_process(COMMAND pkg-config --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
241     add_custom_command(
242          OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h
243          COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE}
244     )
245 endif ()
246
247 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
248     ${WEBCORE_DIR}/css/mediaControlsGtk.css
249 )
250
251 set(WebCore_USER_AGENT_SCRIPTS
252     ${WEBCORE_DIR}/English.lproj/mediaControlsLocalizedStrings.js
253     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsBase.js
254     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsGtk.js
255 )
256
257 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp)
258
259 list(APPEND WebCore_LIBRARIES
260     ${ATK_LIBRARIES}
261     ${CAIRO_LIBRARIES}
262     ${ENCHANT_LIBRARIES}
263     ${FONTCONFIG_LIBRARIES}
264     ${FREETYPE2_LIBRARIES}
265     ${GEOCLUE_LIBRARIES}
266     ${GLIB_GIO_LIBRARIES}
267     ${GLIB_GMODULE_LIBRARIES}
268     ${GLIB_GOBJECT_LIBRARIES}
269     ${GLIB_LIBRARIES}
270     ${GUDEV_LIBRARIES}
271     ${HARFBUZZ_LIBRARIES}
272     ${ICU_LIBRARIES}
273     ${JPEG_LIBRARIES}
274     ${LIBSECRET_LIBRARIES}
275     ${LIBSOUP_LIBRARIES}
276     ${LIBXML2_LIBRARIES}
277     ${LIBXSLT_LIBRARIES}
278     ${PNG_LIBRARIES}
279     ${SQLITE_LIBRARIES}
280     ${WEBP_LIBRARIES}
281     ${X11_X11_LIB}
282     ${X11_Xcomposite_LIB}
283     ${X11_Xdamage_LIB}
284     ${X11_Xrender_LIB}
285     ${X11_Xt_LIB}
286     ${ZLIB_LIBRARIES}
287 )
288
289 list(APPEND WebCore_INCLUDE_DIRECTORIES
290     ${ATK_INCLUDE_DIRS}
291     ${CAIRO_INCLUDE_DIRS}
292     ${ENCHANT_INCLUDE_DIRS}
293     ${FREETYPE2_INCLUDE_DIRS}
294     ${GEOCLUE_INCLUDE_DIRS}
295     ${GIO_UNIX_INCLUDE_DIRS}
296     ${GLIB_INCLUDE_DIRS}
297     ${GUDEV_INCLUDE_DIRS}
298     ${HARFBUZZ_INCLUDE_DIRS}
299     ${ICU_INCLUDE_DIRS}
300     ${LIBSECRET_INCLUDE_DIRS}
301     ${LIBSOUP_INCLUDE_DIRS}
302     ${LIBXML2_INCLUDE_DIR}
303     ${LIBXSLT_INCLUDE_DIR}
304     ${SQLITE_INCLUDE_DIR}
305     ${WEBP_INCLUDE_DIRS}
306     ${ZLIB_INCLUDE_DIRS}
307 )
308
309 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
310     list(APPEND WebCore_INCLUDE_DIRECTORIES
311         ${WEBCORE_DIR}/platform/graphics/gstreamer
312         ${GSTREAMER_INCLUDE_DIRS}
313         ${GSTREAMER_BASE_INCLUDE_DIRS}
314         ${GSTREAMER_APP_INCLUDE_DIRS}
315         ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
316     )
317
318     list(APPEND WebCore_LIBRARIES
319         ${GSTREAMER_APP_LIBRARIES}
320         ${GSTREAMER_BASE_LIBRARIES}
321         ${GSTREAMER_LIBRARIES}
322         ${GSTREAMER_PBUTILS_LIBRARIES}
323         ${GSTREAMER_AUDIO_LIBRARIES}
324     )
325     # Avoiding a GLib deprecation warning due to GStreamer API using deprecated classes.
326     set_source_files_properties(platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp PROPERTIES COMPILE_DEFINITIONS "GLIB_DISABLE_DEPRECATION_WARNINGS=1")
327 endif ()
328
329 if (ENABLE_VIDEO)
330     list(APPEND WebCore_INCLUDE_DIRECTORIES
331         ${GSTREAMER_TAG_INCLUDE_DIRS}
332         ${GSTREAMER_VIDEO_INCLUDE_DIRS}
333     )
334     list(APPEND WebCore_LIBRARIES
335         ${GSTREAMER_TAG_LIBRARIES}
336         ${GSTREAMER_VIDEO_LIBRARIES}
337     )
338
339     if (USE_GSTREAMER_MPEGTS)
340         list(APPEND WebCore_INCLUDE_DIRECTORIES
341             ${GSTREAMER_MPEGTS_INCLUDE_DIRS}
342         )
343
344         list(APPEND WebCore_LIBRARIES
345             ${GSTREAMER_MPEGTS_LIBRARIES}
346         )
347     endif ()
348
349     if (USE_GSTREAMER_GL)
350         list(APPEND WebCore_INCLUDE_DIRECTORIES
351             ${GSTREAMER_GL_INCLUDE_DIRS}
352         )
353
354         list(APPEND WebCore_LIBRARIES
355             ${GSTREAMER_GL_LIBRARIES}
356         )
357     endif ()
358 endif ()
359
360 if (ENABLE_WEB_AUDIO)
361     list(APPEND WebCore_INCLUDE_DIRECTORIES
362         ${WEBCORE_DIR}/platform/audio/gstreamer
363         ${GSTREAMER_AUDIO_INCLUDE_DIRS}
364         ${GSTREAMER_FFT_INCLUDE_DIRS}
365     )
366     list(APPEND WebCore_LIBRARIES
367         ${GSTREAMER_FFT_LIBRARIES}
368     )
369 endif ()
370
371 if (ENABLE_TEXTURE_MAPPER)
372     list(APPEND WebCore_INCLUDE_DIRECTORIES
373         "${WEBCORE_DIR}/platform/graphics/texmap"
374     )
375     list(APPEND WebCore_SOURCES
376         platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
377         platform/graphics/texmap/TextureMapperGL.cpp
378         platform/graphics/texmap/TextureMapperShaderProgram.cpp
379     )
380 endif ()
381
382 if (ENABLE_THREADED_COMPOSITOR)
383     list(APPEND WebCore_INCLUDE_DIRECTORIES
384         "${WEBCORE_DIR}/page/scrolling/coordinatedgraphics"
385         "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
386         "${WEBCORE_DIR}/platform/graphics/texmap/threadedcompositor"
387     )
388     list(APPEND WebCore_SOURCES
389         page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
390         page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
391         page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp
392         page/scrolling/ScrollingStateStickyNode.cpp
393         page/scrolling/ScrollingThread.cpp
394         page/scrolling/ScrollingTreeNode.cpp
395         page/scrolling/ScrollingTreeScrollingNode.cpp
396         platform/graphics/TiledBackingStore.cpp
397         platform/graphics/texmap/coordinated/AreaAllocator.cpp
398         platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
399         platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
400         platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
401         platform/graphics/texmap/coordinated/CoordinatedSurface.cpp
402         platform/graphics/texmap/coordinated/CoordinatedTile.cpp
403         platform/graphics/texmap/coordinated/UpdateAtlas.cpp
404     )
405 endif ()
406
407 if (WTF_USE_EGL)
408     list(APPEND WebCore_LIBRARIES
409         ${EGL_LIBRARY}
410     )
411 endif ()
412
413 if (WTF_USE_OPENGL_ES_2)
414     list(APPEND WebCore_SOURCES
415         platform/graphics/opengl/Extensions3DOpenGLES.cpp
416         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
417     )
418 endif ()
419
420 if (WTF_USE_OPENGL)
421     list(APPEND WebCore_SOURCES
422         platform/graphics/OpenGLShims.cpp
423
424         platform/graphics/opengl/Extensions3DOpenGL.cpp
425         platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
426     )
427 endif ()
428
429 if (ENABLE_PLUGIN_PROCESS_GTK2)
430     # WebKitPluginProcess2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
431     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
432     # for the plugin process.
433     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
434     add_dependencies(WebCorePlatformGTK2 WebCore)
435     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK2)
436     set_property(TARGET WebCorePlatformGTK2
437         APPEND
438         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
439     )
440     set_property(
441         TARGET WebCorePlatformGTK2
442         APPEND
443         PROPERTY INCLUDE_DIRECTORIES
444             ${WebCore_INCLUDE_DIRECTORIES}
445             ${GTK2_INCLUDE_DIRS}
446             ${GDK2_INCLUDE_DIRS}
447     )
448     target_link_libraries(WebCorePlatformGTK2
449          ${WebCore_LIBRARIES}
450          ${GTK2_LIBRARIES}
451          ${GDK2_LIBRARIES}
452     )
453 endif ()
454
455 # Wayland protocol extension.
456 add_custom_command(
457     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
458     DEPENDS ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml
459     COMMAND wayland-scanner server-header < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandServerProtocol.h
460     COMMAND wayland-scanner client-header < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.h
461     COMMAND wayland-scanner code < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
462 )
463
464 if (ENABLE_WAYLAND_TARGET)
465     list(APPEND WebCorePlatformGTK_SOURCES
466         platform/graphics/wayland/WaylandDisplay.cpp
467         platform/graphics/wayland/WaylandEventSource.cpp
468         platform/graphics/wayland/WaylandSurface.cpp
469
470         ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
471     )
472
473     list(APPEND WebCore_INCLUDE_DIRECTORIES
474         ${WAYLAND_INCLUDE_DIRECTORIES}
475     )
476     list(APPEND WebCore_LIBRARIES
477         ${WAYLAND_LIBRARIES}
478     )
479 endif ()
480
481 add_library(WebCorePlatformGTK ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
482 add_dependencies(WebCorePlatformGTK WebCore)
483 WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK)
484 set_property(
485     TARGET WebCorePlatformGTK
486     APPEND
487     PROPERTY INCLUDE_DIRECTORIES
488         ${WebCore_INCLUDE_DIRECTORIES}
489         ${GTK_INCLUDE_DIRS}
490         ${GDK_INCLUDE_DIRS}
491 )
492 target_link_libraries(WebCorePlatformGTK
493     ${WebCore_LIBRARIES}
494     ${GTK_LIBRARIES}
495     ${GDK_LIBRARIES}
496 )
497
498 include_directories(
499     ${WebCore_INCLUDE_DIRECTORIES}
500     "${WEBCORE_DIR}/bindings/gobject/"
501     "${DERIVED_SOURCES_DIR}"
502     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
503 )
504
505 list(APPEND GObjectDOMBindings_SOURCES
506     bindings/gobject/ConvertToUTF8String.cpp
507     bindings/gobject/DOMObjectCache.cpp
508     bindings/gobject/GObjectEventListener.cpp
509     bindings/gobject/GObjectNodeFilterCondition.cpp
510     bindings/gobject/GObjectXPathNSResolver.cpp
511     bindings/gobject/WebKitDOMCustom.cpp
512     bindings/gobject/WebKitDOMDeprecated.cpp
513     bindings/gobject/WebKitDOMEventTarget.cpp
514     bindings/gobject/WebKitDOMHTMLPrivate.cpp
515     bindings/gobject/WebKitDOMNodeFilter.cpp
516     bindings/gobject/WebKitDOMObject.cpp
517     bindings/gobject/WebKitDOMPrivate.cpp
518     bindings/gobject/WebKitDOMXPathNSResolver.cpp
519     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
520     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
521     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
522 )
523
524 list(APPEND GObjectDOMBindingsStable_IDL_FILES
525     css/CSSRule.idl
526     css/CSSRuleList.idl
527     css/CSSStyleDeclaration.idl
528     css/CSSStyleSheet.idl
529     css/CSSValue.idl
530     css/MediaList.idl
531     css/StyleSheet.idl
532     css/StyleSheetList.idl
533
534     dom/Attr.idl
535     dom/CDATASection.idl
536     dom/CharacterData.idl
537     dom/Comment.idl
538     dom/DOMImplementation.idl
539     dom/Document.idl
540     dom/DocumentFragment.idl
541     dom/DocumentType.idl
542     dom/Element.idl
543     dom/EntityReference.idl
544     dom/Event.idl
545     dom/KeyboardEvent.idl
546     dom/MouseEvent.idl
547     dom/NamedNodeMap.idl
548     dom/Node.idl
549     dom/NodeIterator.idl
550     dom/NodeList.idl
551     dom/ProcessingInstruction.idl
552     dom/Range.idl
553     dom/Text.idl
554     dom/TreeWalker.idl
555     dom/UIEvent.idl
556     dom/WheelEvent.idl
557
558     fileapi/Blob.idl
559     fileapi/File.idl
560     fileapi/FileList.idl
561
562     html/HTMLAnchorElement.idl
563     html/HTMLAppletElement.idl
564     html/HTMLAreaElement.idl
565     html/HTMLBRElement.idl
566     html/HTMLBaseElement.idl
567     html/HTMLBaseFontElement.idl
568     html/HTMLBodyElement.idl
569     html/HTMLButtonElement.idl
570     html/HTMLCanvasElement.idl
571     html/HTMLCollection.idl
572     html/HTMLDListElement.idl
573     html/HTMLDirectoryElement.idl
574     html/HTMLDivElement.idl
575     html/HTMLDocument.idl
576     html/HTMLElement.idl
577     html/HTMLEmbedElement.idl
578     html/HTMLFieldSetElement.idl
579     html/HTMLFontElement.idl
580     html/HTMLFormElement.idl
581     html/HTMLFrameElement.idl
582     html/HTMLFrameSetElement.idl
583     html/HTMLHRElement.idl
584     html/HTMLHeadElement.idl
585     html/HTMLHeadingElement.idl
586     html/HTMLHtmlElement.idl
587     html/HTMLIFrameElement.idl
588     html/HTMLImageElement.idl
589     html/HTMLInputElement.idl
590     html/HTMLLIElement.idl
591     html/HTMLLabelElement.idl
592     html/HTMLLegendElement.idl
593     html/HTMLLinkElement.idl
594     html/HTMLMapElement.idl
595     html/HTMLMarqueeElement.idl
596     html/HTMLMenuElement.idl
597     html/HTMLMetaElement.idl
598     html/HTMLModElement.idl
599     html/HTMLOListElement.idl
600     html/HTMLObjectElement.idl
601     html/HTMLOptGroupElement.idl
602     html/HTMLOptionElement.idl
603     html/HTMLOptionsCollection.idl
604     html/HTMLParagraphElement.idl
605     html/HTMLParamElement.idl
606     html/HTMLPreElement.idl
607     html/HTMLQuoteElement.idl
608     html/HTMLScriptElement.idl
609     html/HTMLSelectElement.idl
610     html/HTMLStyleElement.idl
611     html/HTMLTableCaptionElement.idl
612     html/HTMLTableCellElement.idl
613     html/HTMLTableColElement.idl
614     html/HTMLTableElement.idl
615     html/HTMLTableRowElement.idl
616     html/HTMLTableSectionElement.idl
617     html/HTMLTextAreaElement.idl
618     html/HTMLTitleElement.idl
619     html/HTMLUListElement.idl
620
621     page/DOMWindow.idl
622
623     xml/XPathExpression.idl
624     xml/XPathResult.idl
625 )
626
627 list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
628     Modules/battery/BatteryManager.idl
629
630     Modules/gamepad/deprecated/Gamepad.idl
631     Modules/gamepad/deprecated/GamepadList.idl
632
633     Modules/geolocation/Geolocation.idl
634
635     Modules/mediasource/VideoPlaybackQuality.idl
636
637     Modules/quota/StorageInfo.idl
638     Modules/quota/StorageQuota.idl
639
640     Modules/speech/DOMWindowSpeechSynthesis.idl
641     Modules/speech/SpeechSynthesis.idl
642     Modules/speech/SpeechSynthesisEvent.idl
643     Modules/speech/SpeechSynthesisUtterance.idl
644     Modules/speech/SpeechSynthesisVoice.idl
645
646     Modules/webdatabase/Database.idl
647
648     css/DOMWindowCSS.idl
649     css/MediaQueryList.idl
650     css/StyleMedia.idl
651
652     dom/DOMNamedFlowCollection.idl
653     dom/DOMStringList.idl
654     dom/DOMStringMap.idl
655     dom/MessagePort.idl
656     dom/Touch.idl
657     dom/WebKitNamedFlow.idl
658
659     html/DOMSettableTokenList.idl
660     html/DOMTokenList.idl
661     html/HTMLDetailsElement.idl
662     html/HTMLKeygenElement.idl
663     html/HTMLMediaElement.idl
664     html/MediaController.idl
665     html/MediaError.idl
666     html/TimeRanges.idl
667     html/ValidityState.idl
668
669     loader/appcache/DOMApplicationCache.idl
670
671     page/BarProp.idl
672     page/DOMSecurityPolicy.idl
673     page/DOMSelection.idl
674     page/History.idl
675     page/Location.idl
676     page/Navigator.idl
677     page/Performance.idl
678     page/PerformanceEntry.idl
679     page/PerformanceEntryList.idl
680     page/PerformanceNavigation.idl
681     page/PerformanceTiming.idl
682     page/Screen.idl
683     page/UserMessageHandler.idl
684     page/UserMessageHandlersNamespace.idl
685     page/WebKitPoint.idl
686     page/WebKitNamespace.idl
687
688     plugins/DOMMimeType.idl
689     plugins/DOMMimeTypeArray.idl
690     plugins/DOMPlugin.idl
691     plugins/DOMPluginArray.idl
692
693     storage/Storage.idl
694 )
695
696 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
697     list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
698         html/HTMLAudioElement.idl
699         html/HTMLVideoElement.idl
700
701         html/track/AudioTrack.idl
702         html/track/AudioTrackList.idl
703         html/track/DataCue.idl
704         html/track/TextTrack.idl
705         html/track/TextTrackCue.idl
706         html/track/TextTrackCueList.idl
707         html/track/TextTrackList.idl
708         html/track/TrackEvent.idl
709         html/track/VTTCue.idl
710         html/track/VideoTrack.idl
711         html/track/VideoTrackList.idl
712     )
713 endif ()
714
715 if (ENABLE_QUOTA)
716     list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
717         Modules/quota/DOMWindowQuota.idl
718         Modules/quota/NavigatorStorageQuota.idl
719         Modules/quota/StorageErrorCallback.idl
720         Modules/quota/StorageInfo.idl
721         Modules/quota/StorageQuota.idl
722         Modules/quota/StorageQuotaCallback.idl
723         Modules/quota/StorageUsageCallback.idl
724         Modules/quota/WorkerNavigatorStorageQuota.idl
725     )
726 endif ()
727
728 set(GObjectDOMBindings_STATIC_CLASS_LIST Custom Deprecated EventTarget NodeFilter Object XPathNSResolver)
729
730 set(GObjectDOMBindingsStable_CLASS_LIST ${GObjectDOMBindings_STATIC_CLASS_LIST})
731 set(GObjectDOMBindingsStable_INSTALLED_HEADERS
732      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
733      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
734      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustom.h
735      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMDeprecated.h
736      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMEventTarget.h
737      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMNodeFilter.h
738      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMObject.h
739      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMXPathNSResolver.h
740 )
741
742 set(GObjectDOMBindingsUnstable_INSTALLED_HEADERS
743      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
744      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustomUnstable.h
745 )
746
747 foreach (file ${GObjectDOMBindingsStable_IDL_FILES})
748     get_filename_component(classname ${file} NAME_WE)
749     list(APPEND GObjectDOMBindingsStable_CLASS_LIST ${classname})
750     list(APPEND GObjectDOMBindingsStable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
751     list(APPEND GObjectDOMBindingsUnstable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}Unstable.h)
752 endforeach ()
753
754 foreach (file ${GObjectDOMBindingsUnstable_IDL_FILES})
755     get_filename_component(classname ${file} NAME_WE)
756     list(APPEND GObjectDOMBindingsUnstable_CLASS_LIST ${classname})
757     list(APPEND GObjectDOMBindingsUnstable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
758 endforeach ()
759
760 set(GOBJECT_DOM_BINDINGS_FEATURES_DEFINES "LANGUAGE_GOBJECT=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
761 string(REPLACE "ENABLE_INDEXED_DATABASE=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
762 string(REPLACE REGEX "ENABLE_SVG[A-Z_]+=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
763
764 file(MAKE_DIRECTORY ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR})
765
766 add_custom_command(
767     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
768     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
769     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
770 )
771
772 add_custom_command(
773     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
774     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
775     COMMAND echo ${GObjectDOMBindingsUnstable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines-unstable > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
776 )
777
778 add_custom_command(
779     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
780     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
781     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl gdom > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
782 )
783
784 # Some of the static headers are included by generated public headers with include <webkitdom/WebKitDOMFoo.h>.
785 # We need those headers in the derived sources to be in webkitdom directory.
786 set(GObjectDOMBindings_STATIC_HEADER_NAMES ${GObjectDOMBindings_STATIC_CLASS_LIST} CustomUnstable)
787 foreach (classname ${GObjectDOMBindings_STATIC_HEADER_NAMES})
788     add_custom_command(
789         OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h
790         DEPENDS ${WEBCORE_DIR}/bindings/gobject/WebKitDOM${classname}.h
791         COMMAND ln -n -s -f ${WEBCORE_DIR}/bindings/gobject/WebKitDOM${classname}.h ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
792     )
793     list(APPEND GObjectDOMBindings_STATIC_GENERATED_SOURCES ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
794 endforeach ()
795
796 add_custom_target(fake-generated-webkitdom-headers
797     DEPENDS ${GObjectDOMBindings_STATIC_GENERATED_SOURCES}
798 )
799
800 set(GObjectDOMBindings_IDL_FILES ${GObjectDOMBindingsStable_IDL_FILES} ${GObjectDOMBindingsUnstable_IDL_FILES})
801 set(ADDITIONAL_BINDINGS_DEPENDENCIES
802     ${WEBCORE_DIR}/bindings/gobject/webkitdom.symbols
803     ${WINDOW_CONSTRUCTORS_FILE}
804     ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
805     ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
806 )
807 GENERATE_BINDINGS(GObjectDOMBindings_SOURCES
808     "${GObjectDOMBindings_IDL_FILES}"
809     "${WEBCORE_DIR}"
810     "${IDL_INCLUDES}"
811     "${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES}"
812     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
813     WebKitDOM GObject cpp
814     ${IDL_ATTRIBUTES_FILE}
815     ${SUPPLEMENTAL_DEPENDENCY_FILE}
816     ${ADDITIONAL_BINDINGS_DEPENDENCIES})
817
818 add_definitions(-DBUILDING_WEBKIT)
819 add_definitions(-DWEBKIT_DOM_USE_UNSTABLE_API)
820
821 add_library(GObjectDOMBindings STATIC ${GObjectDOMBindings_SOURCES})
822
823 WEBKIT_SET_EXTRA_COMPILER_FLAGS(GObjectDOMBindings)
824
825 add_dependencies(GObjectDOMBindings
826     WebCore
827     fake-generated-webkitdom-headers
828 )
829
830 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkitdom.cfg
831     "[webkitdomgtk-${WEBKITGTK_API_VERSION}]\n"
832     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
833     "namespace=webkit_dom\n"
834     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
835     "       -I${WEBCORE_DIR}/bindings\n"
836     "       -I${WEBCORE_DIR}/bindings/gobject\n"
837     "       -I${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
838     "doc_dir=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/docs\n"
839     "source_dirs=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
840     "            ${WEBCORE_DIR}/bindings/gobject\n"
841     "headers=${GObjectDOMBindingsStable_INSTALLED_HEADERS}\n"
842     "main_sgml_file=webkitdomgtk-docs.sgml\n"
843 )
844
845 install(FILES ${GObjectDOMBindingsStable_INSTALLED_HEADERS}
846         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkitdom"
847 )
848
849 # Make unstable header optional if they don't exist
850 install(FILES ${GObjectDOMBindingsUnstable_INSTALLED_HEADERS}
851         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkitdom"
852         OPTIONAL
853 )
854
855 # Some installed headers are not on the list of headers used for gir generation.
856 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindingsStable_INSTALLED_HEADERS})
857 list(REMOVE_ITEM GObjectDOMBindings_GIR_HEADERS
858      bindings/gobject/WebKitDOMEventTarget.h
859      bindings/gobject/WebKitDOMNodeFilter.h
860      bindings/gobject/WebKitDOMObject.h
861      bindings/gobject/WebKitDOMXPathNSResolver.h
862 )
863
864 # Propagate this variable to the parent scope, so that it can be used in other parts of the build.
865 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindings_GIR_HEADERS} PARENT_SCOPE)
866
867 if (ENABLE_SUBTLE_CRYPTO)
868     list(APPEND WebCore_SOURCES
869         crypto/CryptoAlgorithm.cpp
870         crypto/CryptoAlgorithmDescriptionBuilder.cpp
871         crypto/CryptoAlgorithmRegistry.cpp
872         crypto/CryptoKey.cpp
873         crypto/CryptoKeyPair.cpp
874         crypto/SubtleCrypto.cpp
875         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
876         crypto/algorithms/CryptoAlgorithmAES_KW.cpp
877         crypto/algorithms/CryptoAlgorithmHMAC.cpp
878         crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
879         crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
880         crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
881         crypto/algorithms/CryptoAlgorithmSHA1.cpp
882         crypto/algorithms/CryptoAlgorithmSHA224.cpp
883         crypto/algorithms/CryptoAlgorithmSHA256.cpp
884         crypto/algorithms/CryptoAlgorithmSHA384.cpp
885         crypto/algorithms/CryptoAlgorithmSHA512.cpp
886
887         crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp
888         crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp
889         crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp
890         crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp
891         crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp
892         crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp
893         crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp
894         crypto/gnutls/CryptoDigestGnuTLS.cpp
895         crypto/gnutls/CryptoKeyRSAGnuTLS.cpp
896         crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp
897
898         crypto/keys/CryptoKeyAES.cpp
899         crypto/keys/CryptoKeyDataOctetSequence.cpp
900         crypto/keys/CryptoKeyDataRSAComponents.cpp
901         crypto/keys/CryptoKeyHMAC.cpp
902         crypto/keys/CryptoKeySerializationRaw.cpp
903     )
904
905     list(APPEND WebCore_INCLUDE_DIRECTORIES
906         ${GNUTLS_INCLUDE_DIRS}
907     )
908     list(APPEND WebCore_LIBRARIES
909         ${GNUTLS_LIBRARIES}
910     )
911 endif ()