From 170d903a7e43424e3721e2ecd41832cf8d2dc8a4 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 24 Nov 2023 13:03:15 +0100 Subject: [PATCH] CMake: Fix doc building when current prefix is different from original When qtbase + qtools is built with -DCMAKE_INSTALL_PREFIX=/opt/foo and then qtsvg is built with -DCMAKE_INSTALL_PREFIX=/ building docs will fail to find the installed .qdocconf files with an error like: qtsvg/src/svg/doc/qtsvg.qdocconf:1: (qdoc) error: Cannot open file '//doc/global/qt-module-defaults.qdocconf': No such file or directory That's because we pass QT_INSTALL_DOCS=/ (pointing to the new prefix) as an env var to qdoc and it uses that to try and include various qdocconf files. Instead of passing the currently specified CMAKE_INSTALL_PREFIX, use QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX which points to where qtbase was installed (and thus all previous .qdocconf files). This was already in the code but we preferred CMAKE_INSTALL_PREFIX when it was set, so just remove it. Change-Id: Ibe326132b9504341fa998d9e772ea2bea79727c0 Reviewed-by: Alexey Edelev (cherry picked from commit 72be53ca28905f49973767677ad18af7c4208740) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtDocsHelpers.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake index 48ed5a324bf..3a02e6f34d7 100644 --- a/cmake/QtDocsHelpers.cmake +++ b/cmake/QtDocsHelpers.cmake @@ -119,8 +119,6 @@ function(qt_internal_add_docs) if(QT_SUPERBUILD) set(qt_install_docs_env "${QtBase_BINARY_DIR}/${INSTALL_DOCDIR}") - elseif(QT_WILL_INSTALL) - set(qt_install_docs_env "${CMAKE_INSTALL_PREFIX}/${INSTALL_DOCDIR}") else() set(qt_install_docs_env "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_DOCDIR}") endif()