[GTK] [CMake] Clean up library linking
[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/linux"
18     "${WEBCORE_DIR}/platform/mediastream/gstreamer"
19     "${WEBCORE_DIR}/platform/mock/mediasource"
20     "${WEBCORE_DIR}/platform/network/gtk"
21     "${WEBCORE_DIR}/platform/network/soup"
22     "${WEBCORE_DIR}/platform/text/gtk"
23     "${WEBCORE_DIR}/platform/text/icu"
24     "${WEBCORE_DIR}/plugins/gtk"
25 )
26
27 list(APPEND WebCore_SOURCES
28     editing/SmartReplace.cpp
29
30     html/shadow/MediaControlsGtk.cpp
31
32     loader/soup/CachedRawResourceSoup.cpp
33     loader/soup/SubresourceLoaderSoup.cpp
34
35     platform/Cursor.cpp
36     platform/PlatformStrategies.cpp
37
38     platform/audio/gstreamer/AudioDestinationGStreamer.cpp
39     platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
40     platform/audio/gstreamer/FFTFrameGStreamer.cpp
41     platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
42
43     platform/geoclue/GeolocationProviderGeoclue.cpp
44
45     platform/graphics/GraphicsContext3DPrivate.cpp
46     platform/graphics/OpenGLShims.cpp
47     platform/graphics/WOFFFileFormat.cpp
48
49     platform/graphics/cairo/BitmapImageCairo.cpp
50     platform/graphics/cairo/CairoUtilities.cpp
51     platform/graphics/cairo/DrawingBufferCairo.cpp
52     platform/graphics/cairo/FloatRectCairo.cpp
53     platform/graphics/cairo/FontCairo.cpp
54     platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
55     platform/graphics/cairo/GradientCairo.cpp
56     platform/graphics/cairo/GraphicsContext3DCairo.cpp
57     platform/graphics/cairo/ImageBufferCairo.cpp
58     platform/graphics/cairo/ImageCairo.cpp
59     platform/graphics/cairo/IntRectCairo.cpp
60     platform/graphics/cairo/OwnPtrCairo.cpp
61     platform/graphics/cairo/PathCairo.cpp
62     platform/graphics/cairo/PatternCairo.cpp
63     platform/graphics/cairo/PlatformContextCairo.cpp
64     platform/graphics/cairo/PlatformPathCairo.cpp
65     platform/graphics/cairo/RefPtrCairo.cpp
66     platform/graphics/cairo/TileCairo.cpp
67     platform/graphics/cairo/TiledBackingStoreBackendCairo.cpp
68     platform/graphics/cairo/TransformationMatrixCairo.cpp
69
70     platform/graphics/freetype/FontCacheFreeType.cpp
71     platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
72     platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
73     platform/graphics/freetype/SimpleFontDataFreeType.cpp
74
75     platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp
76     platform/graphics/gstreamer/GRefPtrGStreamer.cpp
77     platform/graphics/gstreamer/GStreamerUtilities.cpp
78     platform/graphics/gstreamer/ImageGStreamerCairo.cpp
79     platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
80     platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
81     platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
82     platform/graphics/gstreamer/MediaSourceGStreamer.cpp
83     platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp
84     platform/graphics/gstreamer/TextCombinerGStreamer.cpp
85     platform/graphics/gstreamer/TextSinkGStreamer.cpp
86     platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
87     platform/graphics/gstreamer/VideoSinkGStreamer.cpp
88     platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
89     platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp
90     platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
91
92     platform/graphics/harfbuzz/HarfBuzzFace.cpp
93     platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
94     platform/graphics/harfbuzz/HarfBuzzShaper.cpp
95
96     platform/graphics/opengl/Extensions3DOpenGL.cpp
97     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
98     platform/graphics/opengl/Extensions3DOpenGLES.cpp
99     platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
100     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
101     platform/graphics/opengl/TemporaryOpenGLSetting.cpp
102
103     platform/graphics/opentype/OpenTypeVerticalData.cpp
104
105     platform/gtk/GamepadsGtk.cpp
106
107     platform/image-decoders/cairo/ImageDecoderCairo.cpp
108
109     platform/linux/GamepadDeviceLinux.cpp
110
111     platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
112
113     platform/network/soup/AuthenticationChallengeSoup.cpp
114     platform/network/soup/CertificateInfo.cpp
115     platform/network/soup/CookieJarSoup.cpp
116     platform/network/soup/CookieStorageSoup.cpp
117     platform/network/soup/CredentialStorageSoup.cpp
118     platform/network/soup/DNSSoup.cpp
119     platform/network/soup/NetworkStorageSessionSoup.cpp
120     platform/network/soup/ProxyResolverSoup.cpp
121     platform/network/soup/ProxyServerSoup.cpp
122     platform/network/soup/ResourceErrorSoup.cpp
123     platform/network/soup/ResourceHandleSoup.cpp
124     platform/network/soup/ResourceRequestSoup.cpp
125     platform/network/soup/ResourceResponseSoup.cpp
126     platform/network/soup/SocketStreamHandleSoup.cpp
127     platform/network/soup/SoupNetworkSession.cpp
128     platform/network/soup/SynchronousLoaderClientSoup.cpp
129
130     platform/soup/SharedBufferSoup.cpp
131     platform/soup/URLSoup.cpp
132
133     platform/text/icu/UTextProvider.cpp
134     platform/text/icu/UTextProviderLatin1.cpp
135     platform/text/icu/UTextProviderUTF16.cpp
136     platform/text/LocaleICU.cpp
137     platform/text/TextCodecICU.cpp
138     platform/text/TextEncodingDetectorICU.cpp
139
140     platform/text/enchant/TextCheckerEnchant.cpp
141
142     platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
143
144     platform/network/gtk/CredentialBackingStore.cpp
145 )
146
147 list(APPEND WebCorePlatformGTK_SOURCES
148     accessibility/atk/AXObjectCacheAtk.cpp
149     accessibility/atk/AccessibilityObjectAtk.cpp
150     accessibility/atk/WebKitAccessibleHyperlink.cpp
151     accessibility/atk/WebKitAccessibleInterfaceAction.cpp
152     accessibility/atk/WebKitAccessibleInterfaceComponent.cpp
153     accessibility/atk/WebKitAccessibleInterfaceDocument.cpp
154     accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp
155     accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp
156     accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp
157     accessibility/atk/WebKitAccessibleInterfaceImage.cpp
158     accessibility/atk/WebKitAccessibleInterfaceSelection.cpp
159     accessibility/atk/WebKitAccessibleInterfaceTable.cpp
160     accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp
161     accessibility/atk/WebKitAccessibleInterfaceText.cpp
162     accessibility/atk/WebKitAccessibleInterfaceValue.cpp
163     accessibility/atk/WebKitAccessibleUtil.cpp
164     accessibility/atk/WebKitAccessibleWrapperAtk.cpp
165
166     editing/atk/FrameSelectionAtk.cpp
167
168     page/gtk/DragControllerGtk.cpp
169     page/gtk/EventHandlerGtk.cpp
170
171     platform/audio/gtk/AudioBusGtk.cpp
172
173     platform/cairo/WidgetBackingStoreCairo.cpp
174
175     platform/graphics/GLContext.cpp
176
177     platform/graphics/cairo/GraphicsContextCairo.cpp
178
179     platform/graphics/egl/GLContextEGL.cpp
180
181     platform/graphics/freetype/FontPlatformDataFreeType.cpp
182
183     platform/graphics/glx/GLContextGLX.cpp
184
185     platform/graphics/gtk/ColorGtk.cpp
186     platform/graphics/gtk/GdkCairoUtilities.cpp
187     platform/graphics/gtk/IconGtk.cpp
188     platform/graphics/gtk/ImageBufferGtk.cpp
189     platform/graphics/gtk/ImageGtk.cpp
190     platform/graphics/gtk/IntPointGtk.cpp
191     platform/graphics/gtk/IntRectGtk.cpp
192
193     platform/gtk/ClipboardUtilitiesGtk.cpp
194     platform/gtk/ContextMenuGtk.cpp
195     platform/gtk/ContextMenuItemGtk.cpp
196     platform/gtk/CursorGtk.cpp
197     platform/gtk/DataObjectGtk.cpp
198     platform/gtk/DragDataGtk.cpp
199     platform/gtk/DragIcon.cpp
200     platform/gtk/DragImageGtk.cpp
201     platform/gtk/ErrorsGtk.cpp
202     platform/gtk/EventLoopGtk.cpp
203     platform/gtk/FileSystemGtk.cpp
204     platform/gtk/GRefPtrGtk.cpp
205     platform/gtk/GtkClickCounter.cpp
206     platform/gtk/GtkDragAndDropHelper.cpp
207     platform/gtk/GtkInputMethodFilter.cpp
208     platform/gtk/GtkPluginWidget.cpp
209     platform/gtk/GtkPopupMenu.cpp
210     platform/gtk/GtkTouchContextHelper.cpp
211     platform/gtk/GtkUtilities.cpp
212     platform/gtk/GtkVersioning.c
213     platform/gtk/KeyBindingTranslator.cpp
214     platform/gtk/LanguageGtk.cpp
215     platform/gtk/LocalizedStringsGtk.cpp
216     platform/gtk/LoggingGtk.cpp
217     platform/gtk/MIMETypeRegistryGtk.cpp
218     platform/gtk/MainFrameScrollbarGtk.cpp
219     platform/gtk/PasteboardGtk.cpp
220     platform/gtk/PasteboardHelper.cpp
221     platform/gtk/PlatformKeyboardEventGtk.cpp
222     platform/gtk/PlatformMouseEventGtk.cpp
223     platform/gtk/PlatformScreenGtk.cpp
224     platform/gtk/PlatformWheelEventGtk.cpp
225     platform/gtk/PopupMenuGtk.cpp
226     platform/gtk/RedirectedXCompositeWindow.cpp
227     platform/gtk/RenderThemeGtk.cpp
228     platform/gtk/RenderThemeGtk2.cpp
229     platform/gtk/RenderThemeGtk3.cpp
230     platform/gtk/ScrollViewGtk.cpp
231     platform/gtk/ScrollbarThemeGtk.cpp
232     platform/gtk/ScrollbarThemeGtk2.cpp
233     platform/gtk/ScrollbarThemeGtk3.cpp
234     platform/gtk/SearchPopupMenuGtk.cpp
235     platform/gtk/SharedBufferGtk.cpp
236     platform/gtk/SharedTimerGtk.cpp
237     platform/gtk/SoundGtk.cpp
238     platform/gtk/TemporaryLinkStubs.cpp
239     platform/gtk/UserAgentGtk.cpp
240     platform/gtk/WebKitAuthenticationWidget.cpp
241     platform/gtk/WidgetBackingStoreGtkX11.cpp
242     platform/gtk/WidgetGtk.cpp
243     platform/gtk/WidgetRenderingContext.cpp
244 )
245
246 if (ENABLE_NETSCAPE_PLUGIN_API)
247     list(APPEND WebCore_SOURCES
248         plugins/PluginDatabase.cpp
249         plugins/PluginDebug.cpp
250         plugins/PluginPackage.cpp
251         plugins/PluginStream.cpp
252         plugins/PluginView.cpp
253     )
254
255     list(APPEND WebCorePlatformGTK_SOURCES
256         plugins/gtk/PluginPackageGtk.cpp
257         plugins/gtk/PluginViewGtk.cpp
258         plugins/gtk/gtk2xtbin.c
259
260         plugins/x11/PluginViewX11.cpp
261     )
262 else ()
263     list(APPEND WebCore_SOURCES
264         plugins/PluginPackageNone.cpp
265         plugins/PluginViewNone.cpp
266     )
267 endif ()
268
269 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
270     ${WEBCORE_DIR}/css/mediaControlsGtk.css
271 )
272
273 set(WebCore_USER_AGENT_SCRIPTS
274     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsApple.js
275     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsGtk.js
276 )
277
278 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp)
279
280 list(APPEND WebCore_LIBRARIES
281     ${ATK_LIBRARIES}
282     ${CAIRO_LIBRARIES}
283     ${ENCHANT_LIBRARIES}
284     ${FONTCONFIG_LIBRARIES}
285     ${FREETYPE_LIBRARIES}
286     ${GEOCLUE_LIBRARIES}
287     ${GLIB_GIO_LIBRARIES}
288     ${GLIB_GMODULE_LIBRARIES}
289     ${GLIB_GOBJECT_LIBRARIES}
290     ${GLIB_LIBRARIES}
291     ${GUDEV_LIBRARIES}
292     ${HARFBUZZ_LIBRARIES}
293     ${ICU_LIBRARIES}
294     ${JPEG_LIBRARIES}
295     ${LIBSOUP_LIBRARIES}
296     ${LIBXML2_LIBRARIES}
297     ${LIBXSLT_LIBRARIES}
298     ${PNG_LIBRARIES}
299     ${SQLITE_LIBRARIES}
300     ${WEBP_LIBRARIES}
301     ${X11_X11_LIB}
302     ${X11_Xcomposite_LIB}
303     ${X11_Xdamage_LIB}
304     ${X11_Xrender_LIB}
305     ${XT_LIBRARIES}
306     ${ZLIB_LIBRARIES}
307 )
308
309 list(APPEND WebCore_INCLUDE_DIRECTORIES
310     ${ATK_INCLUDE_DIRS}
311     ${CAIRO_INCLUDE_DIRS}
312     ${ENCHANT_INCLUDE_DIRS}
313     ${FREETYPE_INCLUDE_DIRS}
314     ${GEOCLUE_INCLUDE_DIRS}
315     ${GIO_UNIX_INCLUDE_DIRS}
316     ${GLIB_INCLUDE_DIRS}
317     ${GUDEV_INCLUDE_DIRS}
318     ${HARFBUZZ_INCLUDE_DIRS}
319     ${ICU_INCLUDE_DIRS}
320     ${LIBSOUP_INCLUDE_DIRS}
321     ${LIBXML2_INCLUDE_DIR}
322     ${LIBXSLT_INCLUDE_DIR}
323     ${SQLITE_INCLUDE_DIR}
324     ${WEBP_INCLUDE_DIRS}
325     ${XT_INCLUDE_DIRS}
326     ${ZLIB_INCLUDE_DIRS}
327 )
328
329 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
330     list(APPEND WebCore_INCLUDE_DIRECTORIES
331         ${WEBCORE_DIR}/platform/graphics/gstreamer
332         ${GSTREAMER_INCLUDE_DIRS}
333         ${GSTREAMER_BASE_INCLUDE_DIRS}
334         ${GSTREAMER_APP_INCLUDE_DIRS}
335         ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
336     )
337
338     list(APPEND WebCore_LIBRARIES
339         ${GSTREAMER_APP_LIBRARIES}
340         ${GSTREAMER_BASE_LIBRARIES}
341         ${GSTREAMER_LIBRARIES}
342         ${GSTREAMER_PBUTILS_LIBRARIES}
343     )
344     # Avoiding a GLib deprecation warning due to GStreamer API using deprecated classes.
345     set_source_files_properties(platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp PROPERTIES COMPILE_DEFINITIONS "GLIB_DISABLE_DEPRECATION_WARNINGS=1")
346 endif ()
347
348 if (ENABLE_VIDEO)
349     list(APPEND WebCore_INCLUDE_DIRECTORIES
350         ${GSTREAMER_VIDEO_INCLUDE_DIRS}
351     )
352     list(APPEND WebCore_LIBRARIES
353         ${GSTREAMER_VIDEO_LIBRARIES}
354     )
355 endif ()
356
357 if (ENABLE_WEB_AUDIO)
358     list(APPEND WebCore_INCLUDE_DIRECTORIES
359         ${WEBCORE_DIR}/platform/audio/gstreamer
360         ${GSTREAMER_AUDIO_INCLUDE_DIRS}
361         ${GSTREAMER_FFT_INCLUDE_DIRS}
362     )
363     list(APPEND WebCore_LIBRARIES
364         ${GSTREAMER_AUDIO_LIBRARIES}
365         ${GSTREAMER_FFT_LIBRARIES}
366     )
367 endif ()
368
369 if (ENABLE_TEXTURE_MAPPER)
370     list(APPEND WebCore_INCLUDE_DIRECTORIES
371         "${WEBCORE_DIR}/platform/graphics/texmap"
372     )
373     list(APPEND WebCore_SOURCES
374         platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
375         platform/graphics/texmap/TextureMapperGL.cpp
376         platform/graphics/texmap/TextureMapperShaderProgram.cpp
377     )
378 endif ()
379
380 if (WTF_USE_EGL)
381     list(APPEND WebCore_LIBRARIES
382         ${EGL_LIBRARY}
383     )
384 endif ()
385
386 install(FILES "${WEBCORE_DIR}/Resources/textAreaResizeCorner.png"
387               "${WEBCORE_DIR}/Resources/nullPlugin.png"
388               "${WEBCORE_DIR}/Resources/urlIcon.png"
389               "${WEBCORE_DIR}/Resources/missingImage.png"
390               "${WEBCORE_DIR}/Resources/panIcon.png"
391               "${WEBCORE_DIR}/Resources/deleteButton.png"
392               "${WEBCORE_DIR}/Resources/inputSpeech.png"
393         DESTINATION "${DATA_INSTALL_DIR}/images"
394 )
395
396 if (ENABLE_WEB_AUDIO)
397     install(FILES "${WEBCORE_DIR}/platform/audio/resources/Composite.wav"
398             DESTINATION "${DATA_INSTALL_DIR}/resources/audio"
399     )
400 endif ()
401
402 if (ENABLE_WEBKIT2)
403     # WebKit2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
404     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
405     # for the plugin process.
406     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
407     add_dependencies(WebCorePlatformGTK2 WebCore)
408     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK2)
409     set_property(TARGET WebCorePlatformGTK2
410         APPEND
411         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
412     )
413     set_property(
414         TARGET WebCorePlatformGTK2
415         APPEND
416         PROPERTY INCLUDE_DIRECTORIES
417             ${WebCore_INCLUDE_DIRECTORIES}
418             ${GTK2_INCLUDE_DIRS}
419             ${GDK2_INCLUDE_DIRS}
420     )
421     target_link_libraries(WebCorePlatformGTK2
422          ${WebCore_LIBRARIES}
423          ${GTK2_LIBRARIES}
424          ${GDK2_LIBRARIES}
425     )
426 endif ()
427
428 add_library(WebCorePlatformGTK ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
429 add_dependencies(WebCorePlatformGTK WebCore)
430 WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK)
431 set_property(
432     TARGET WebCorePlatformGTK
433     APPEND
434     PROPERTY INCLUDE_DIRECTORIES
435         ${WebCore_INCLUDE_DIRECTORIES}
436         ${GTK_INCLUDE_DIRS}
437         ${GDK_INCLUDE_DIRS}
438 )
439 target_link_libraries(WebCorePlatformGTK
440     ${WebCore_LIBRARIES}
441     ${GTK_LIBRARIES}
442     ${GDK_LIBRARIES}
443 )
444
445 include_directories(
446     "${WebCore_INCLUDE_DIRECTORIES}"
447     "${DERIVED_SOURCES_DIR}"
448     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
449 )
450
451 list(APPEND GObjectDOMBindings_SOURCES
452     bindings/gobject/ConvertToUTF8String.cpp
453     bindings/gobject/DOMObjectCache.cpp
454     bindings/gobject/GObjectEventListener.cpp
455     bindings/gobject/WebKitDOMCustom.cpp
456     bindings/gobject/WebKitDOMDeprecated.cpp
457     bindings/gobject/WebKitDOMEventTarget.cpp
458     bindings/gobject/WebKitDOMHTMLPrivate.cpp
459     bindings/gobject/WebKitDOMObject.cpp
460     bindings/gobject/WebKitDOMPrivate.cpp
461     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
462     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
463 )
464
465 list(APPEND GObjectDOMBindings_IDL_FILES
466     Modules/battery/BatteryManager.idl
467     Modules/gamepad/Gamepad.idl
468     Modules/gamepad/GamepadList.idl
469     Modules/geolocation/Geolocation.idl
470     Modules/mediasource/VideoPlaybackQuality.idl
471     Modules/quota/StorageInfo.idl
472     Modules/quota/StorageQuota.idl
473     Modules/webdatabase/Database.idl
474
475     css/CSSRule.idl
476     css/CSSRuleList.idl
477     css/CSSStyleDeclaration.idl
478     css/CSSStyleSheet.idl
479     css/CSSValue.idl
480     css/DOMWindowCSS.idl
481     css/MediaList.idl
482     css/MediaQueryList.idl
483     css/StyleMedia.idl
484     css/StyleSheet.idl
485     css/StyleSheetList.idl
486
487     dom/Attr.idl
488     dom/CDATASection.idl
489     dom/CharacterData.idl
490     dom/Comment.idl
491     dom/DOMImplementation.idl
492     dom/DOMNamedFlowCollection.idl
493     dom/DOMStringList.idl
494     dom/DOMStringMap.idl
495     dom/Document.idl
496     dom/DocumentFragment.idl
497     dom/DocumentType.idl
498     dom/Element.idl
499     dom/EntityReference.idl
500     dom/Event.idl
501     dom/KeyboardEvent.idl
502     dom/MessagePort.idl
503     dom/MouseEvent.idl
504     dom/NamedNodeMap.idl
505     dom/Node.idl
506     dom/NodeFilter.idl
507     dom/NodeIterator.idl
508     dom/NodeList.idl
509     dom/ProcessingInstruction.idl
510     dom/Range.idl
511     dom/Text.idl
512     dom/Touch.idl
513     dom/TreeWalker.idl
514     dom/UIEvent.idl
515     dom/WebKitNamedFlow.idl
516     dom/WheelEvent.idl
517
518     fileapi/Blob.idl
519     fileapi/File.idl
520     fileapi/FileList.idl
521
522     html/DOMSettableTokenList.idl
523     html/DOMTokenList.idl
524     html/HTMLAnchorElement.idl
525     html/HTMLAppletElement.idl
526     html/HTMLAreaElement.idl
527     html/HTMLBRElement.idl
528     html/HTMLBaseElement.idl
529     html/HTMLBaseFontElement.idl
530     html/HTMLBodyElement.idl
531     html/HTMLButtonElement.idl
532     html/HTMLCanvasElement.idl
533     html/HTMLCollection.idl
534     html/HTMLDListElement.idl
535     html/HTMLDetailsElement.idl
536     html/HTMLDirectoryElement.idl
537     html/HTMLDivElement.idl
538     html/HTMLDocument.idl
539     html/HTMLElement.idl
540     html/HTMLEmbedElement.idl
541     html/HTMLFieldSetElement.idl
542     html/HTMLFontElement.idl
543     html/HTMLFormElement.idl
544     html/HTMLFrameElement.idl
545     html/HTMLFrameSetElement.idl
546     html/HTMLHRElement.idl
547     html/HTMLHeadElement.idl
548     html/HTMLHeadingElement.idl
549     html/HTMLHtmlElement.idl
550     html/HTMLIFrameElement.idl
551     html/HTMLImageElement.idl
552     html/HTMLInputElement.idl
553     html/HTMLKeygenElement.idl
554     html/HTMLLIElement.idl
555     html/HTMLLabelElement.idl
556     html/HTMLLegendElement.idl
557     html/HTMLLinkElement.idl
558     html/HTMLMapElement.idl
559     html/HTMLMarqueeElement.idl
560     html/HTMLMediaElement.idl
561     html/HTMLMenuElement.idl
562     html/HTMLMetaElement.idl
563     html/HTMLModElement.idl
564     html/HTMLOListElement.idl
565     html/HTMLObjectElement.idl
566     html/HTMLOptGroupElement.idl
567     html/HTMLOptionElement.idl
568     html/HTMLOptionsCollection.idl
569     html/HTMLParagraphElement.idl
570     html/HTMLParamElement.idl
571     html/HTMLPreElement.idl
572     html/HTMLQuoteElement.idl
573     html/HTMLScriptElement.idl
574     html/HTMLSelectElement.idl
575     html/HTMLStyleElement.idl
576     html/HTMLTableCaptionElement.idl
577     html/HTMLTableCellElement.idl
578     html/HTMLTableColElement.idl
579     html/HTMLTableElement.idl
580     html/HTMLTableRowElement.idl
581     html/HTMLTableSectionElement.idl
582     html/HTMLTextAreaElement.idl
583     html/HTMLTitleElement.idl
584     html/HTMLUListElement.idl
585     html/MediaController.idl
586     html/MediaError.idl
587     html/TimeRanges.idl
588     html/ValidityState.idl
589
590     loader/appcache/DOMApplicationCache.idl
591
592     page/BarProp.idl
593     page/DOMSecurityPolicy.idl
594     page/DOMSelection.idl
595     page/DOMWindow.idl
596     page/History.idl
597     page/Location.idl
598     page/Navigator.idl
599     page/Performance.idl
600     page/PerformanceEntry.idl
601     page/PerformanceEntryList.idl
602     page/PerformanceNavigation.idl
603     page/PerformanceTiming.idl
604     page/Screen.idl
605     page/WebKitPoint.idl
606
607     plugins/DOMMimeType.idl
608     plugins/DOMMimeTypeArray.idl
609     plugins/DOMPlugin.idl
610     plugins/DOMPluginArray.idl
611
612     storage/Storage.idl
613
614     xml/XPathExpression.idl
615     xml/XPathNSResolver.idl
616     xml/XPathResult.idl
617 )
618
619 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
620     list(APPEND GObjectDOMBindings_IDL_FILES
621         html/HTMLAudioElement.idl
622         html/HTMLVideoElement.idl
623
624         html/track/AudioTrack.idl
625         html/track/AudioTrackList.idl
626         html/track/TextTrack.idl
627         html/track/TextTrackCue.idl
628         html/track/TextTrackCueList.idl
629         html/track/TextTrackList.idl
630         html/track/TrackEvent.idl
631         html/track/VideoTrack.idl
632         html/track/VideoTrackList.idl
633     )
634 endif ()
635
636 set(GObjectDOMBindings_CLASS_LIST Custom EventTarget Object Deprecated)
637 set(GObjectDOMBindings_INSTALLED_HEADERS
638      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
639      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
640      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustom.h
641      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMDeprecated.h
642      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMEventTarget.h
643      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMObject.h
644 )
645 file(GLOB GObjectDOMBindingsSymbolsFiles
646     "${WEBCORE_DIR}/bindings/gobject/WebKitDOM*.symbols"
647 )
648
649 foreach (file ${GObjectDOMBindings_IDL_FILES})
650     get_filename_component(classname ${file} NAME_WE)
651     list(APPEND GObjectDOMBindings_CLASS_LIST ${classname})
652     list(APPEND GObjectDOMBindings_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
653     list(APPEND GObjectDOMBindingsSymbolsFiles ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.symbols)
654 endforeach ()
655
656 set(GOBJECT_DOM_BINDINGS_FEATURES_DEFINES "LANGUAGE_GOBJECT=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
657 string(REPLACE "ENABLE_INDEXED_DATABASE=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
658 string(REPLACE REGEX "ENABLE_SVG[A-Z_]+=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
659
660 file(MAKE_DIRECTORY ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR})
661
662 add_custom_command(
663     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
664     COMMAND echo ${GObjectDOMBindings_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
665 )
666
667 add_custom_command(
668     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
669     COMMAND echo ${GObjectDOMBindings_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl gdom > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
670 )
671
672 add_custom_target(fake-installed-webkitdom-headers
673     COMMAND ln -n -s -f ${WEBCORE_DIR}/bindings/gobject/*.h ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
674 )
675
676 GENERATE_BINDINGS(GObjectDOMBindings_SOURCES
677     "${GObjectDOMBindings_IDL_FILES}"
678     "${WEBCORE_DIR}"
679     "${IDL_INCLUDES}"
680     "${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES}"
681     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
682     WebKitDOM GObject
683     ${IDL_ATTRIBUTES_FILE}
684     ${SUPPLEMENTAL_DEPENDENCY_FILE}
685     ${WINDOW_CONSTRUCTORS_FILE}
686     ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
687     ${SHAREDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
688     ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE})
689
690 add_definitions(-DBUILDING_WEBKIT)
691
692 add_library(GObjectDOMBindings STATIC ${GObjectDOMBindings_SOURCES})
693
694 WEBKIT_SET_EXTRA_COMPILER_FLAGS(GObjectDOMBindings)
695
696 add_dependencies(GObjectDOMBindings
697     WebCore
698     fake-installed-webkitdom-headers
699 )
700
701 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkitdom.cfg
702     "[webkitdomgtk]\n"
703     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
704     "namespace=webkit_dom\n"
705     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
706     "       -I${WEBCORE_DIR}/bindings\n"
707     "       -I${WEBCORE_DIR}/bindings/gobject\n"
708     "       -I${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
709     "doc_dir=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/docs\n"
710     "source_dirs=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
711     "            ${WEBCORE_DIR}/bindings/gobject\n"
712     "headers=${GObjectDOMBindings_INSTALLED_HEADERS}\n"
713 )
714
715 install(FILES ${GObjectDOMBindings_INSTALLED_HEADERS}
716         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkitdom"
717 )
718
719 # Some installed headers are not on the list of headers used for gir generation.
720 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindings_INSTALLED_HEADERS})
721 list(REMOVE_ITEM GObjectDOMBindings_GIR_HEADERS
722      bindings/gobject/WebKitDOMDeprecated.h
723      bindings/gobject/WebKitDOMEventTarget.h
724      bindings/gobject/WebKitDOMObject.h
725 )
726
727 # Propagate this variable to the parent scope, so that it can be used in other parts of the build.
728 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindings_GIR_HEADERS} PARENT_SCOPE)