From 392d9a54194d06e96bfebdaf081aa6c9787e33ab Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 12 Jan 2023 10:18:34 +0100 Subject: CMake: Fix configure -no-rpath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The -no-rpath configure switch had no effect. Pick-to: 6.5 Change-Id: I306ec33249a219066ce94d18da5f1ca3d92905e1 Reviewed-by: Tor Arne Vestbø Reviewed-by: Alexey Edelev Reviewed-by: Amir Masoud Abdol Reviewed-by: Alexandru Croitor --- cmake/QtRpathHelpers.cmake | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'cmake/QtRpathHelpers.cmake') diff --git a/cmake/QtRpathHelpers.cmake b/cmake/QtRpathHelpers.cmake index f37f5a61d6..e842ce74b4 100644 --- a/cmake/QtRpathHelpers.cmake +++ b/cmake/QtRpathHelpers.cmake @@ -82,12 +82,6 @@ function(qt_apply_rpaths) return() endif() - # Rpaths explicitly disabled (like for uikit), equivalent to qmake's no_qt_rpath. - # Or feature was turned OFF. - if(QT_DISABLE_RPATH OR NOT QT_FEATURE_rpath) - return() - endif() - qt_parse_all_arguments(arg "qt_apply_rpaths" "RELATIVE_RPATH" "TARGET;INSTALL_PATH" "" ${ARGN}) if(NOT arg_TARGET) message(FATAL_ERROR "No target given to qt_apply_rpaths.") @@ -95,6 +89,21 @@ function(qt_apply_rpaths) set(target "${arg_TARGET}") endif() + # Rpaths explicitly disabled (like for uikit), equivalent to qmake's no_qt_rpath. + # Or feature was turned OFF. + if(QT_DISABLE_RPATH OR NOT QT_FEATURE_rpath) + set_target_properties(${target} PROPERTIES + SKIP_BUILD_RPATH ON + SKIP_INSTALL_RPATH ON + ) + if(APPLE) + set_target_properties(${target} PROPERTIES + MACOSX_RPATH OFF + ) + endif() + return() + endif() + # If a target is not built (which can happen for tools when crosscompiling, we shouldn't try # to apply properties. if(NOT TARGET "${target}") -- cgit v1.2.3