summaryrefslogtreecommitdiffstats
path: root/cmake/QtPrlHelpers.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-10-28 18:05:24 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-10-29 12:11:53 +0100
commitbae96f1792da1fe0f3ca4b738096c0c1a27eb862 (patch)
tree16c849a77372948f16897ed94ac3782dc60731b4 /cmake/QtPrlHelpers.cmake
parent3a1bc4bad5757d72e5af8b4abe236e3cfac9621d (diff)
CMake: Fix generation of prl files for non-qtbase modules
Previously we determined if a library represented by an absolute path is a Qt module by checking if it's located in the build dir of the current repo. That is not sufficient for non-qtbase prefix builds, where a Qt module might link against both a module in the current build dir and in the prefix dir. Detect such cases, and rewrite the absolute paths to relocatable paths (either framework flags or paths starting with $$[QT_INSTALL_LIBS]. This should fix building examples with qmake that use QtQuick. Fixes: QTBUG-87840 Change-Id: Icaf8f1a7c66292c80662fd0d5771a5a1628a9899 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtPrlHelpers.cmake')
-rw-r--r--cmake/QtPrlHelpers.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/QtPrlHelpers.cmake b/cmake/QtPrlHelpers.cmake
index 932565f318..35d321420c 100644
--- a/cmake/QtPrlHelpers.cmake
+++ b/cmake/QtPrlHelpers.cmake
@@ -270,6 +270,12 @@ QMAKE_PRL_VERSION = ${PROJECT_VERSION}
set(configs ${CMAKE_BUILD_TYPE})
endif()
+ set(qt_lib_dirs "${QT_BUILD_DIR}/${INSTALL_LIBDIR}")
+ if(QT_WILL_INSTALL)
+ list(APPEND qt_lib_dirs
+ "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBDIR}")
+ endif()
+
foreach(config ${configs})
# Output file for dependency tracking, and which will contain the final content.
qt_path_join(prl_step2_path
@@ -296,7 +302,7 @@ QMAKE_PRL_VERSION = ${PROJECT_VERSION}
"-DLIBRARY_PREFIXES=${library_prefixes}"
"-DLIBRARY_SUFFIXES=${library_suffixes}"
"-DLINK_LIBRARY_FLAG=${CMAKE_LINK_LIBRARY_FLAG}"
- "-DQT_BUILD_LIBDIR=${QT_BUILD_DIR}/${INSTALL_LIBDIR}"
+ "-DQT_LIB_DIRS=${qt_lib_dirs}"
-P "${QT_CMAKE_DIR}/QtFinishPrlFile.cmake"
VERBATIM
COMMENT "Generating prl file for target ${target}"