aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2023-02-23 18:47:37 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-28 12:50:59 +0000
commit070cea2585072697341466d1ebbab0295577ca81 (patch)
tree26da374199446a5ebf225ab3ff8668219e2c75ca
parentd01c2454a8189fd870cdf9117c9f3a273efd2ccf (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 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> (cherry picked from commit 80ad280d2cff24fb01af434ff82d8e64f7d48c3e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 ba3270f0f6..6e200079e1 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -1606,12 +1606,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