summaryrefslogtreecommitdiffstats
path: root/cmake/QtDocsHelpers.cmake
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2021-09-29 16:56:27 +0200
committerTopi Reinio <topi.reinio@qt.io>2021-09-30 15:38:07 +0200
commit725b52141d553590d395d51963ee8b60f99ca40d (patch)
treea16ea08866ad2390617a916d80c73d2eb5a57dde /cmake/QtDocsHelpers.cmake
parent8d8448a1f5a935f72ae5206df5ce95c651db1fbc (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. Pick-to: 6.2 Change-Id: Ib1bbf7b9d784e0c276d2bc520240af4a6c8ba903 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtDocsHelpers.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 "")