Skip to content

Commit

Permalink
use CMAKE_INSTALL_FULL_LIBDIR in OpenBSD RPATH setting.
Browse files Browse the repository at this point in the history
also remove the duplicate setting of CMAKE_INSTALL_RPATH
  • Loading branch information
sezero committed Apr 4, 2024
1 parent 044c1f9 commit 43b5476
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,23 @@ IF (UNIX)
)
ENDIF()

### See: http://www.cmake.org/Wiki/CMake_RPATH_handling
IF (SYS_OPENBSD)
# Set RPATH for OpenBSD so WildMIDI can find libWildMidi.so
# 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_PREFIX}/lib")

# 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_PREFIX}/lib" isSystemDir)
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${CMAKE_INSTALL_FULL_LIBDIR} isSystemDir)
IF ("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
ENDIF()
ENDIF()

Expand Down

0 comments on commit 43b5476

Please sign in to comment.