summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-03-18 16:07:44 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-18 17:25:15 +0100
commitedf5fe49b34225932a7752f2bac0e43f7410f46b (patch)
tree0d6b5ae818e6f6e5cf10207a495537d8eb924a93
parentdc4872be38340e2ce804a6a8f79d8c646e7126cf (diff)
CMake: Add global / top-level docs targets
Previously you could use either module-specific or repo-specific 'docs' targets. For example 'ninja html_docs_qtbase' or 'ninja html_docs_Core'. Now there's a global / top-level target called 'docs', so 'ninja docs' works. For super builds it will build the documentation of all configured repositories. For a single repo build, it's equivalent to calling 'ninja docs_repo_name'. Also for consistency, add the "docs_Core" target, which was missing before. So now a 'docs' target exsits for repo names AND targets. New global target names are - docs - prepare_docs - generate_docs - html_docs - qch_docs - install_html_docs_docs - install_qch_docs_docs - install_docs_docs Amends 0095ff4e0659906595d281b37c3b7f89e37250af Change-Id: I686be1e0962e40cbce860e8ac2cabb056b360ac2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--cmake/QtBuild.cmake5
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake22
2 files changed, 26 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index c8163ebdea..407f0b6524 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -3739,10 +3739,15 @@ function(qt_add_docs)
add_custom_target(install_docs_${target})
add_dependencies(install_docs_${target} install_html_docs_${target} install_qch_docs_${target})
+ add_custom_target(docs_${target})
+ add_dependencies(docs_${target} html_docs_${target})
+ add_dependencies(docs_${target} qch_docs_${target})
+
add_dependencies(${qt_docs_prepare_target_name} prepare_docs_${target})
add_dependencies(${qt_docs_generate_target_name} generate_docs_${target})
add_dependencies(${qt_docs_html_target_name} html_docs_${target})
add_dependencies(${qt_docs_qch_target_name} qch_docs_${target})
+ add_dependencies(${qt_docs_target_name} docs_${target})
add_dependencies(${qt_docs_install_html_target_name} install_html_docs_${target})
add_dependencies(${qt_docs_install_qch_target_name} install_qch_docs_${target})
add_dependencies(${qt_docs_install_target_name} install_docs_${target})
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index c945fd124a..5f1566656d 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -64,6 +64,17 @@ macro(qt_build_repo_begin)
# Decide whether tools will be built.
qt_check_if_tools_will_be_built()
+ # Add global docs targets that will work both for per-repo builds, and super builds.
+ if(NOT TARGET docs)
+ add_custom_target(docs)
+ add_custom_target(prepare_docs)
+ add_custom_target(generate_docs)
+ add_custom_target(html_docs)
+ add_custom_target(qch_docs)
+ add_custom_target(install_html_docs_docs)
+ add_custom_target(install_qch_docs_docs)
+ add_custom_target(install_docs_docs)
+ endif()
string(TOLOWER ${PROJECT_NAME} project_name_lower)
@@ -87,10 +98,19 @@ macro(qt_build_repo_begin)
add_dependencies(${qt_docs_generate_target_name} ${qt_docs_prepare_target_name})
add_dependencies(${qt_docs_html_target_name} ${qt_docs_generate_target_name})
- add_dependencies(${qt_docs_target_name} ${qt_docs_html_target_name} ${qt_docs_qch_target_name})
add_dependencies(${qt_docs_install_html_target_name} ${qt_docs_html_target_name})
add_dependencies(${qt_docs_install_qch_target_name} ${qt_docs_qch_target_name})
add_dependencies(${qt_docs_install_target_name} ${qt_docs_install_html_target_name} ${qt_docs_install_qch_target_name})
+
+ # Make global doc targets depend on the module ones.
+ add_dependencies(docs ${qt_docs_target_name})
+ add_dependencies(prepare_docs ${qt_docs_prepare_target_name})
+ add_dependencies(generate_docs ${qt_docs_generate_target_name})
+ add_dependencies(html_docs ${qt_docs_qch_target_name})
+ add_dependencies(qch_docs ${qt_docs_html_target_name})
+ add_dependencies(install_html_docs_docs ${qt_docs_install_html_target_name})
+ add_dependencies(install_qch_docs_docs ${qt_docs_install_qch_target_name})
+ add_dependencies(install_docs_docs ${qt_docs_install_target_name})
endmacro()
macro(qt_build_repo_end)