Skip to content

Commit

Permalink
Merge pull request Reference-LAPACK#1002 from ahnaf-tahmid-chowdhury/…
Browse files Browse the repository at this point in the history
…rpath-fix

Allow User Configuration of RPATH Settings
  • Loading branch information
langou committed Jun 3, 2024
2 parents dd2e5ef + c308ea6 commit a4d0691
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,22 @@ include(GNUInstallDirs)
# the OSX RPATH settings have been updated per recommendations found
# in the CMake Wiki:
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
option(CMAKE_MACOSX_RPATH "Enable macOS RPATH" ON)
message(STATUS "Enable macOS RPATH: ${CMAKE_MACOSX_RPATH}")
option(CMAKE_SKIP_BUILD_RPATH "Skip build-time RPATH" OFF)
message(STATUS "Skip build-time RPATH: ${CMAKE_SKIP_BUILD_RPATH}")
option(CMAKE_BUILD_WITH_INSTALL_RPATH "Build with install RPATH" OFF)
message(STATUS "Build with install RPATH: ${CMAKE_BUILD_WITH_INSTALL_RPATH}")

list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${CMAKE_INSTALL_FULL_LIBDIR} isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

if ("${isSystemDir}" STREQUAL "-1")
if(${CMAKE_INSTALL_FULL_LIBDIR})
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
endif()
message(STATUS "Install RPATH: ${CMAKE_INSTALL_RPATH}")
option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "Use link path for RPATH" TRUE)
message(STATUS "Install RPATH use link path: ${CMAKE_INSTALL_RPATH_USE_LINK_PATH}")
endif()


Expand Down

0 comments on commit a4d0691

Please sign in to comment.