summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-02-03 11:38:10 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-02-03 21:55:38 +0100
commitbb9be221339b67b7580e92efc673f8919f4b1db8 (patch)
treeff8c9e90260ce7785a0a710e3d9fb66c774fa422 /cmake/QtBuild.cmake
parent40828992ebfb1a5f33b523d1495668d271e726a7 (diff)
CMake: Fix rpath set for Qml plugins to not contain lib64
Qt6QmlMacros uses the value of GNUInstallDirs's CMAKE_INSTALL_LIBDIR to calculate the rpath from a Qml plugin's location to the Qt libraries. By default CMake detects the value of CMAKE_INSTALL_LIBDIR, and on an RHEL system it is set to 'lib64', whereas we usually configure Qt with the lib dir set to just 'lib'. This might cause issues with Qml plugins not locating the Qt libs due to an incorrect rpath. Ensure that when building Qt libraries and plugins, CMAKE_INSTALL_LIBDIR is set to the same lib dir value that Qt was configured with. Pick-to: 6.3 Fixes: QTBUG-99707 Task-number: QTBUG-100432 Change-Id: I17b2a22d46ef3b40084a2f6a4992f0e23b35d4d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index b411c6031a..6af23a499e 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -251,6 +251,11 @@ set(CMAKE_INSTALL_RPATH "" CACHE STRING "RPATH for installed binaries")
# link against QtCore.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+# Ensure that GNUInstallDirs's CMAKE_INSTALL_LIBDIR points to the same lib dir that Qt was
+# configured with. Currently this is important for QML plugins, which embed an rpath based
+# on that value.
+set(CMAKE_INSTALL_LIBDIR "${INSTALL_LIBDIR}")
+
function(qt_setup_tool_path_command)
if(NOT CMAKE_HOST_WIN32)
return()