[GTK] [CMake] Add support for generating gtkdoc
[WebKit-https.git] / Source / PlatformGTK.cmake
1 set(DocumentationDependencies
2     "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitenvironment.xml"
3 )
4
5 if (ENABLE_WEBKIT)
6     list(APPEND DocumentationDependencies
7         WebKit
8         "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitgtk-docs.sgml"
9         "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitgtk-sections.txt"
10     )
11 endif ()
12
13 if (ENABLE_WEBKIT2)
14     list(APPEND DocumentationDependencies
15         WebKit2
16         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
17         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt"
18     )
19 endif ()
20
21 add_custom_command(
22     OUTPUT docs-build.stamp
23     DEPENDS ${DocumentationDependencies}
24     COMMAND CC="${CMAKE_C_COMPILER}" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc
25     COMMAND touch docs-build.stamp
26     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
27 )
28
29 add_custom_target(fake-docs-target ALL
30     DEPENDS docs-build.stamp
31 )
32
33 if (ENABLE_WEBKIT)
34     add_dependencies(fake-docs-target WebKit)
35 endif ()
36
37 if (ENABLE_WEBKIT2)
38     add_dependencies(fake-docs-target WebKit2)
39 endif ()
40