From ec3c8475bbd43027725cc4029c277486ad50afbf Mon Sep 17 00:00:00 2001 From: Dan Bailey Date: Tue, 16 Sep 2025 09:59:37 -0700 Subject: [PATCH] Only enable the install rpath if CMAKE_SKIP_RPATH is not set Signed-off-by: Dan Bailey --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 400528c73..742367e01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,9 +160,12 @@ if (NOT CMAKE_COMPILER_IS_ICC) list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") endif() -# add the automatically determined parts of the RPATH -# which point to directories outside the build tree to the install RPATH -SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +if (NOT CMAKE_SKIP_RPATH) + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH + # (provided that the RPATH has not been disabled) + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +endif() # ensure that ARC is shown as enabled in the Xcode UI if(CMAKE_GENERATOR STREQUAL "Xcode")