[GTK] Stop trying to install WebKit1 documentation
[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     "${CMAKE_SOURCE_DIR}/Source/WebKit/gtk/docs/webkitenvironment.xml"
8 )
9
10 if (ENABLE_WEBKIT2)
11     list(APPEND DocumentationDependencies
12         WebKit2
13         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
14         "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt"
15     )
16     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk/html/
17             DESTINATION ${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkit2gtk
18     )
19 endif ()
20
21 macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
22     add_custom_command(
23         OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
24         DEPENDS ${DocumentationDependencies}
25         COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
26         COMMAND touch ${_stamp_name}
27         WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
28     )
29 endmacro()
30
31 add_gtkdoc_generator("docs-build-no-html.stamp" "--skip-html")
32 add_custom_target(gtkdoc-no-html ALL
33     DEPENDS "${CMAKE_BINARY_DIR}/docs-build-no-html.stamp"
34 )
35
36 add_gtkdoc_generator("docs-build.stamp" "")
37 add_custom_target(gtkdoc
38     DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp"
39 )
40
41 add_custom_target(check
42     COMMAND ${TOOLS_DIR}/Scripts/run-gtk-tests
43     COMMAND ${TOOLS_DIR}/gtk/check-for-webkitdom-api-breaks
44 )
45
46 if (ENABLE_WEBKIT AND ENABLE_WEBKIT2)
47     add_custom_command(
48         OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
49         DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
50         DEPENDS ${TOOLS_DIR}/gtk/manifest.txt
51         DEPENDS WebKit
52         DEPENDS WebKit2
53         DEPENDS gtkdoc
54         COMMAND ${TOOLS_DIR}/gtk/make-dist.py
55                 --source-dir=${CMAKE_SOURCE_DIR}
56                 --build-dir=${CMAKE_BINARY_DIR}
57                 --tarball-root=/webkitgtk-${PROJECT_VERSION}
58                 -o ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
59                 ${TOOLS_DIR}/gtk/manifest.txt
60     )
61
62     add_custom_command(
63         OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
64         DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
65         COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
66     )
67
68     add_custom_target(dist
69         DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
70     )
71 endif ()