From 725b52141d553590d395d51963ee8b60f99ca40d Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 29 Sep 2021 16:56:27 +0200 Subject: 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://' 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 --- cmake/QtDocsHelpers.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'cmake') 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 "") -- cgit v1.2.3