diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2023-01-12 10:18:34 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2023-01-17 21:28:06 +0100 |
commit | 392d9a54194d06e96bfebdaf081aa6c9787e33ab (patch) | |
tree | 7d97ab6342db72a4507df893a440683b07995df9 /cmake/QtRpathHelpers.cmake | |
parent | 20821877bba5c2a685098fcf42c9ee48d7b285a5 (diff) |
CMake: Fix configure -no-rpath
The -no-rpath configure switch had no effect.
Pick-to: 6.5
Change-Id: I306ec33249a219066ce94d18da5f1ca3d92905e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtRpathHelpers.cmake')
-rw-r--r-- | cmake/QtRpathHelpers.cmake | 21 |
1 files changed, 15 insertions, 6 deletions
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}") |