summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-04-23 18:25:49 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-26 20:36:19 +0000
commit70d3e15c31aa2fefacda8c261faee73ab4b5f05c (patch)
treef4160321ba596a1bb3a738e4498626c594dd38d6
parent906da939f30f7d03f2eaca30a2516eb4ab1a6dd4 (diff)
CMake: Install prl files from all repo build dirs in a top-level build
Previously, in a top-level build we always generated the final prl file somewhere under QT_BUILD_DIR (which is qtbase_build_dir). After each repo was processed by QtPostProcess.cmake, we installed the prl files found in PROJECT_BINARY_DIR. For qtquickcontrols2 this meant that qml plugin prl files were placed under qtbase/qml, but we tried installing the prl files from qtquickcontrols2/qml, which didn't have any prl files. In a static Qt build, qmake's qt.prf calls qmlimportscanner to identify which plugins should be linked to the executable. This worked fine because the plugin .pri files were installed correctly. None of the qml plugin library dependencies were linked in though. This is supposed to happen in qmake's C++ code where it tries to find the associated prl file of a linked library in order to extract all its dependencies. Because no prl file was found, linking failed with multiple undefined symbols. Fix this by installing the prl files from QT_BUILD_DIR rather than PROJECT_BINARY_DIR. Note that this will create multiple install rules for certain files, but it's harmless. An example is imageformats. We process qtbase plugins, see qjpeg, issue an install rule from under the qtbase/plugins/imageformats folder. We then process qtimageformats plugins, see webp, issue another install rule from under qtbase/plugins/imageformats. The first install rule will install both qjpeg and qwebp, the second install rule will merely say all plugins are up-to-date. Change-Id: I8a4bb67bfafc1d016eab62f4fe66b6ba378ceeb2 Fixes: QTBUG-93021 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 31ee3c84a78afa67eeb4e4b6da5a8181ea62c387) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--cmake/QtPostProcessHelpers.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake
index de4d7deeed..1a0dc02213 100644
--- a/cmake/QtPostProcessHelpers.cmake
+++ b/cmake/QtPostProcessHelpers.cmake
@@ -704,10 +704,15 @@ function(qt_internal_create_config_file_for_standalone_tests)
endfunction()
function(qt_internal_install_prl_files)
- # Install prl files
+ # Get locations relative to QT_BUILD_DIR from which prl files should be installed.
get_property(prl_install_dirs GLOBAL PROPERTY QT_PRL_INSTALL_DIRS)
+
+ # Clear the list of install dirs so the previous values don't pollute the list of install dirs
+ # for the next repository in a top-level build.
+ set_property(GLOBAL PROPERTY QT_PRL_INSTALL_DIRS "")
+
foreach(prl_install_dir ${prl_install_dirs})
- qt_install(DIRECTORY "${PROJECT_BINARY_DIR}/${prl_install_dir}/"
+ qt_install(DIRECTORY "${QT_BUILD_DIR}/${prl_install_dir}/"
DESTINATION ${prl_install_dir}
FILES_MATCHING PATTERN "*.prl"
)