[GTK][CMake] Generate GObject DOM bindings .symbols files
[WebKit-https.git] / Source / PlatformGTK.cmake
1 add_subdirectory(${WEBCORE_DIR}/platform/gtk/po)
2
3 # This allows exposing a 'gir' target which builds all GObject introspection files.
4 add_custom_target(gir ALL DEPENDS ${GObjectIntrospectionTargets})
5
6 set(DocumentationDependencies
7     generate-gdom-symbols-file
8     "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitenvironment.xml"
9 )
10
11 if (ENABLE_WEBKIT)
12     list(APPEND DocumentationDependencies
13         WebKit
14         "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitgtk-docs.sgml"
15         "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitgtk-sections.txt"
16     )
17     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkitgtk/html/
18             DESTINATION ${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkitgtk
19     )
20 endif ()
21
22 if (ENABLE_WEBKIT2)
23     list(APPEND DocumentationDependencies
24         WebKit2
25         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
26         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt"
27     )
28     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk/html/
29             DESTINATION ${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkit2gtk
30     )
31 endif ()
32
33 add_custom_command(
34     OUTPUT "${CMAKE_BINARY_DIR}/docs-build.stamp"
35     DEPENDS ${DocumentationDependencies}
36     COMMAND CC="${CMAKE_C_COMPILER}" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc
37     COMMAND touch docs-build.stamp
38     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
39 )
40
41 add_custom_target(fake-docs-target ALL
42     DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp"
43 )
44
45 if (ENABLE_WEBKIT)
46     add_dependencies(fake-docs-target WebKit)
47 endif ()
48
49 if (ENABLE_WEBKIT2)
50     add_dependencies(fake-docs-target WebKit2)
51 endif ()
52
53 add_custom_target(check
54     COMMAND "${TOOLS_DIR}/Scripts/run-gtk-tests"
55 )
56
57 if (ENABLE_WEBKIT AND ENABLE_WEBKIT2)
58     add_custom_command(
59         OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
60         DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
61         DEPENDS ${TOOLS_DIR}/gtk/manifest.txt
62         DEPENDS WebKit
63         DEPENDS WebKit2
64         COMMAND ${TOOLS_DIR}/gtk/make-dist.py
65                 --source-dir=${CMAKE_SOURCE_DIR}
66                 --build-dir=${CMAKE_BINARY_DIR}
67                 --tarball-root=/webkitgtk-${PROJECT_VERSION}
68                 -o ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
69                 ${TOOLS_DIR}/gtk/manifest.txt
70     )
71
72     add_custom_command(
73         OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
74         DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
75         COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
76     )
77
78     add_custom_target(dist
79         DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
80     )
81 endif ()