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