Skip to content

Commit

Permalink
Set the RPATH in the installed strumpack library
Browse files Browse the repository at this point in the history
  • Loading branch information
pghysels committed Aug 16, 2023
1 parent f301da7 commit d9cc43e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,29 @@ include(GNUInstallDirs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")

##############################################################
## settings for RPATH,
## see https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")

# 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)

# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_LIBDIR}" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
endif("${isSystemDir}" STREQUAL "-1")
##############################################################

# figure out Fortran/C name mangling
include(FortranCInterface)
FortranCInterface_HEADER(
Expand Down

0 comments on commit d9cc43e

Please sign in to comment.