summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2021-09-29 16:56:27 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-30 20:29:55 +0000
commit953c3592894d9bb99a3799ee0cf06f61a1af1254 (patch)
tree6d9251806d9d319321ea3db7390da2f67de723a5 /cmake
parente9b56fd1650b7772f9639e2149919d520fd67a9d (diff)
CMake: Introduce QT_BUILD_ONLINE_DOCS flag for documentation builds
QDoc modifies its linking behavior depending on whether the -installdir command line option was set or not; Without -installdir, QDoc will use 'https://<url>' to link to targets loaded from external documentation modules, instead of using relative paths. Drop the -installdir if QT_BUILD_ONLINE_DOCS was set. This behavior matches the 'build_online_docs' scope that was used for qmake documentation targets, and is useful for documentation projects that are not part of Qt but want to link to Qt docs simply by loading the index files of Qt's modules. Change-Id: Ib1bbf7b9d784e0c276d2bc520240af4a6c8ba903 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 725b52141d553590d395d51963ee8b60f99ca40d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtDocsHelpers.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake
index d534ee3e8b..2a190b5c59 100644
--- a/cmake/QtDocsHelpers.cmake
+++ b/cmake/QtDocsHelpers.cmake
@@ -101,13 +101,17 @@ function(qt_internal_add_docs)
# prepare docs target
set(prepare_qdoc_args
-outputdir "${qdoc_output_dir}"
- -installdir "${QT_INSTALL_DIR}/${INSTALL_DOCDIR}"
"${target_source_dir}/${doc_project}"
-prepare
-indexdir "${index_dir}"
-no-link-errors
"${include_path_args}"
)
+ if(NOT QT_BUILD_ONLINE_DOCS)
+ list(PREPEND prepare_qdoc_args
+ -installdir "${QT_INSTALL_DIR}/${INSTALL_DOCDIR}"
+ )
+ endif()
if(QT_SUPERBUILD)
set(qt_install_docs_env "${QtBase_BINARY_DIR}/${INSTALL_DOCDIR}")
@@ -136,12 +140,16 @@ function(qt_internal_add_docs)
# generate docs target
set(generate_qdocs_args
-outputdir "${qdoc_output_dir}"
- -installdir "${INSTALL_DOCDIR}"
"${target_source_dir}/${doc_project}"
-generate
-indexdir "${index_dir}"
"${include_path_args}"
)
+ if(NOT QT_BUILD_ONLINE_DOCS)
+ list(PREPEND generate_qdoc_args
+ -installdir "${QT_INSTALL_DIR}/${INSTALL_DOCDIR}"
+ )
+ endif()
foreach(target_prefix generate_top_level_docs generate_repo_docs generate_docs)
set(depends_arg "")