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