diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-02-03 11:38:10 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-04 02:49:14 +0000 |
commit | 5631d8d65576ad18e96ea8fad76f5255a9a7f90d (patch) | |
tree | b842e3401f9beeb6fc05a5810b30b89ac5459a73 /cmake/QtBuild.cmake | |
parent | 112eaefa343d075add4d0b40a99af0004c8d3852 (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.
Fixes: QTBUG-99707
Task-number: QTBUG-100432
Change-Id: I17b2a22d46ef3b40084a2f6a4992f0e23b35d4d3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit bb9be221339b67b7580e92efc673f8919f4b1db8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index b06dec60d8..c4e6077fc6 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() |