[GTK] check target looks broken
[WebKit-https.git] / Source / PlatformGTK.cmake
1 include(WebKitDist)
2
3 add_subdirectory(${WEBCORE_DIR}/platform/gtk/po)
4
5 # This allows exposing a 'gir' target which builds all GObject introspection files.
6 if (ENABLE_INTROSPECTION)
7     add_custom_target(gir ALL DEPENDS ${GObjectIntrospectionTargets})
8 endif ()
9
10 list(APPEND DocumentationDependencies
11     WebKit
12     "${CMAKE_SOURCE_DIR}/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
13     "${CMAKE_SOURCE_DIR}/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-${WEBKITGTK_API_VERSION}-sections.txt"
14 )
15
16 if (ENABLE_GTKDOC)
17     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk-${WEBKITGTK_API_VERSION}/html/webkit2gtk-${WEBKITGTK_API_VERSION}
18             DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkit2gtk-${WEBKITGTK_API_VERSION}"
19     )
20     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk-${WEBKITGTK_API_VERSION}/html/webkitdomgtk-${WEBKITGTK_API_VERSION}
21             DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkitdomgtk-${WEBKITGTK_API_VERSION}"
22     )
23     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/jsc-glib-${WEBKITGTK_API_VERSION}/html/jsc-glib-${WEBKITGTK_API_VERSION}
24             DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/jsc-glib-${WEBKITGTK_API_VERSION}"
25     )
26 endif ()
27
28 macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
29     add_custom_command(
30         OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
31         DEPENDS ${DocumentationDependencies}
32         COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
33         COMMAND touch ${_stamp_name}
34         WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
35         VERBATIM
36     )
37 endmacro()
38
39 ADD_GTKDOC_GENERATOR("docs-build.stamp" "")
40 if (ENABLE_GTKDOC)
41     add_custom_target(gtkdoc ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
42 elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APPLE)
43     add_custom_target(gtkdoc DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
44
45     # Add a default build step which check that documentation does not have any warnings
46     # or errors. This is useful to prevent breaking documentation inadvertently during
47     # the course of development.
48     if (DEVELOPER_MODE)
49         ADD_GTKDOC_GENERATOR("docs-build-no-html.stamp" "--skip-html")
50         add_custom_target(gtkdoc-no-html ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build-no-html.stamp")
51     endif ()
52 endif ()
53
54 add_custom_target(check
55     COMMAND ${TOOLS_DIR}/Scripts/run-gtk-tests
56     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
57     VERBATIM
58 )
59
60 if (DEVELOPER_MODE)
61     add_custom_target(Documentation DEPENDS gtkdoc)
62     WEBKIT_DECLARE_DIST_TARGETS(GTK webkitgtk ${TOOLS_DIR}/gtk/manifest.txt.in)
63 endif ()