blob: 28841c20e98a7a52ce0d37de488fc980852aed8b [file] [log] [blame]
mcatanzaro@igalia.come836b662017-11-03 18:42:55 +00001include(WebKitDist)
2
mrobinson@webkit.orga91ef602013-12-29 18:51:26 +00003add_subdirectory(${WEBCORE_DIR}/platform/gtk/po)
4
mrobinson@webkit.orgd3a19862013-12-30 18:44:31 +00005# This allows exposing a 'gir' target which builds all GObject introspection files.
carlosgc@webkit.orgadc1b452014-11-01 09:55:47 +00006if (ENABLE_INTROSPECTION)
7 add_custom_target(gir ALL DEPENDS ${GObjectIntrospectionTargets})
8endif ()
mrobinson@webkit.orgd3a19862013-12-30 18:44:31 +00009
commit-queue@webkit.org676092b2014-09-17 09:29:31 +000010list(APPEND DocumentationDependencies
mcatanzaro@igalia.comd0d3e862017-09-19 00:29:31 +000011 WebKit
matthew_hanson@apple.com3dab0582017-07-14 02:29:22 +000012 "${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"
commit-queue@webkit.org676092b2014-09-17 09:29:31 +000014)
mrobinson@webkit.org5c89df92014-05-11 02:14:09 +000015
16if (ENABLE_GTKDOC)
carlosgc@webkit.org38ec27b2018-04-20 10:33:30 +000017 install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk-${WEBKITGTK_API_VERSION}/html/webkit2gtk-${WEBKITGTK_API_VERSION}
commit-queue@webkit.org3062a4c2018-05-10 06:44:00 +000018 DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html"
mrobinson@webkit.org742e8e42014-01-06 00:25:34 +000019 )
carlosgc@webkit.org38ec27b2018-04-20 10:33:30 +000020 install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk-${WEBKITGTK_API_VERSION}/html/webkitdomgtk-${WEBKITGTK_API_VERSION}
commit-queue@webkit.org3062a4c2018-05-10 06:44:00 +000021 DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html"
carlosgc@webkit.orgddf70dc2014-08-14 10:31:39 +000022 )
carlosgc@webkit.org38ec27b2018-04-20 10:33:30 +000023 install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/jsc-glib-${WEBKITGTK_API_VERSION}/html/jsc-glib-${WEBKITGTK_API_VERSION}
commit-queue@webkit.org3062a4c2018-05-10 06:44:00 +000024 DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html"
carlosgc@webkit.org38ec27b2018-04-20 10:33:30 +000025 )
mrobinson@webkit.org80a4d2e2013-12-23 21:49:43 +000026endif ()
gns@gnome.orge4caf1a2013-12-23 22:01:12 +000027
mrobinson@webkit.org6b6e5d42014-03-10 18:35:55 +000028macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
29 add_custom_command(
30 OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
31 DEPENDS ${DocumentationDependencies}
mcatanzaro@igalia.com8b224d42017-08-08 15:03:48 +000032 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}
mrobinson@webkit.org6b6e5d42014-03-10 18:35:55 +000033 COMMAND touch ${_stamp_name}
34 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
mcatanzaro@igalia.com8b224d42017-08-08 15:03:48 +000035 VERBATIM
mrobinson@webkit.org6b6e5d42014-03-10 18:35:55 +000036 )
37endmacro()
38
mcatanzaro@igalia.comd0d3e862017-09-19 00:29:31 +000039ADD_GTKDOC_GENERATOR("docs-build.stamp" "")
mrobinson@webkit.org5c89df92014-05-11 02:14:09 +000040if (ENABLE_GTKDOC)
41 add_custom_target(gtkdoc ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
philn@webkit.org6eb1cba2015-12-30 08:31:15 +000042elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APPLE)
mrobinson@webkit.org5c89df92014-05-11 02:14:09 +000043 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)
mcatanzaro@igalia.comd0d3e862017-09-19 00:29:31 +000049 ADD_GTKDOC_GENERATOR("docs-build-no-html.stamp" "--skip-html")
mrobinson@webkit.org5c89df92014-05-11 02:14:09 +000050 add_custom_target(gtkdoc-no-html ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build-no-html.stamp")
51 endif ()
52endif ()
gns@gnome.orge4caf1a2013-12-23 22:01:12 +000053
mrobinson@webkit.org19bfa3f2014-01-14 00:42:25 +000054add_custom_target(check
mrobinson@webkit.orgaac040c2014-03-04 18:43:54 +000055 COMMAND ${TOOLS_DIR}/Scripts/run-gtk-tests
mcatanzaro@igalia.comf3132912018-04-24 01:07:57 +000056 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
57 VERBATIM
mrobinson@webkit.org19bfa3f2014-01-14 00:42:25 +000058)
mrobinson@webkit.orgd497a992014-01-30 22:34:15 +000059
commit-queue@webkit.orgb9cdb3e2015-01-19 21:58:05 +000060if (DEVELOPER_MODE)
mcatanzaro@igalia.come836b662017-11-03 18:42:55 +000061 add_custom_target(Documentation DEPENDS gtkdoc)
62 WEBKIT_DECLARE_DIST_TARGETS(GTK webkitgtk ${TOOLS_DIR}/gtk/manifest.txt.in)
commit-queue@webkit.orgb9cdb3e2015-01-19 21:58:05 +000063endif ()