aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2023-02-23 18:47:37 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2023-02-24 12:39:55 +0100
commit80ad280d2cff24fb01af434ff82d8e64f7d48c3e (patch)
treeaa3afadd9dae2a3b46886a60a7d3abc34c18662b /src/qml/Qt6QmlMacros.cmake
parentaf76a73c5d544b686f71429452e17542d05166e2 (diff)
Avoid setting INSTALL_RPATH if it was set before
Avoid setting INSTALL_RPATH for Qml plugins if it was set before. This is mostly applicable for the Qml plugins built in Qt tree, that got INSTALL_RPATH from the qt_internal_add_plugin function, but also can be the case for the user Qml plugins created manually. Fixes: QTBUG-111381 Pick-to: 6.5 6.4 6.2 Change-Id: Ia643259dc9027b3abbbf4ba93e3e56199903100d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 15073b120e..b6899f8e00 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -1687,12 +1687,18 @@ function(qt6_add_qml_plugin target)
)
endif()
+ get_target_property(install_rpath ${target} INSTALL_RPATH)
# Ignore any CMAKE_INSTALL_RPATH and set a better default RPATH on platforms
# that support it, if allowed. Projects will often set CMAKE_INSTALL_RPATH
# for executables or backing libraries, but forget about plugins. Because
# the path for QML plugins depends on their URI, it is unlikely that
# CMAKE_INSTALL_RPATH would ever be intended for use with QML plugins.
- if(NOT WIN32 AND NOT QT_NO_QML_PLUGIN_RPATH)
+ #
+ # Avoid setting INSTALL_RPATH if it was set before. This is mostly
+ # applicable for the Qml plugins built in Qt tree, that got INSTALL_RPATH
+ # from the qt_internal_add_plugin function, but also can be the case for the
+ # user Qml plugins created manually.
+ if(NOT WIN32 AND NOT QT_NO_QML_PLUGIN_RPATH AND NOT install_rpath)
# Construct a relative path from a default install location (assumed to
# be qml/target-path) to ${CMAKE_INSTALL_LIBDIR}. This would be
# applicable for Apple too (although unusual) if this is a bare install