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>
This commit is contained in:
Joerg Bornemann 2023-01-12 10:18:34 +01:00
parent 20821877bb
commit 392d9a5419

View File

@ -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}")