[CMake] [GTK] Add support for GObject introspection
[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 endif ()
26
27 if (ENABLE_WEBKIT2)
28     list(APPEND DocumentationDependencies
29         WebKit2
30         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
31         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt"
32     )
33 endif ()
34
35 add_custom_command(
36     OUTPUT docs-build.stamp
37     DEPENDS ${DocumentationDependencies}
38     COMMAND CC="${CMAKE_C_COMPILER}" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc
39     COMMAND touch docs-build.stamp
40     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
41 )
42
43 add_custom_target(fake-docs-target ALL
44     DEPENDS docs-build.stamp
45 )
46
47 if (ENABLE_WEBKIT)
48     add_dependencies(fake-docs-target WebKit)
49 endif ()
50
51 if (ENABLE_WEBKIT2)
52     add_dependencies(fake-docs-target WebKit2)
53 endif ()