[GTK] [CMake] Ensure that the autotools build and the CMake install the same 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 if (ENABLE_API_TESTS)
7     if (ENABLE_WEBKIT)
8         add_subdirectory(${WEBKIT_DIR}/gtk/tests)
9     endif ()
10     if (ENABLE_WEBKIT2)
11         add_subdirectory(${WEBKIT2_DIR}/UIProcess/API/gtk/tests)
12     endif ()
13 endif ()
14
15 set(DocumentationDependencies
16     "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitenvironment.xml"
17 )
18
19 if (ENABLE_WEBKIT)
20     list(APPEND DocumentationDependencies
21         WebKit
22         "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitgtk-docs.sgml"
23         "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitgtk-sections.txt"
24     )
25     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkitgtk/html/
26             DESTINATION ${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkitgtk
27     )
28 endif ()
29
30 if (ENABLE_WEBKIT2)
31     list(APPEND DocumentationDependencies
32         WebKit2
33         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
34         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt"
35     )
36     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk/html/
37             DESTINATION ${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkit2gtk
38     )
39 endif ()
40
41 add_custom_command(
42     OUTPUT docs-build.stamp
43     DEPENDS ${DocumentationDependencies}
44     COMMAND CC="${CMAKE_C_COMPILER}" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc
45     COMMAND touch docs-build.stamp
46     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
47 )
48
49 add_custom_target(fake-docs-target ALL
50     DEPENDS docs-build.stamp
51 )
52
53 if (ENABLE_WEBKIT)
54     add_dependencies(fake-docs-target WebKit)
55 endif ()
56
57 if (ENABLE_WEBKIT2)
58     add_dependencies(fake-docs-target WebKit2)
59 endif ()