Skip to content

Commit

Permalink
Use relative rpath to find libpython.so correctly in installed directory
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Aug 4, 2022
1 parent cfd56e3 commit 16bc6fd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ endif(CMAKE_BUILD_TYPE MATCHES Debug)
option(WITH_PYMALLOC "Define if you want to compile in Python-specific mallocs" ON)
option(WITH_THREAD "Compile in rudimentary thread support" ON)
if(UNIX)
set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)

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

# relative to `python` binary
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")

#list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
#if("${isSystemDir}" STREQUAL "-1")
# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
#endif("${isSystemDir}" STREQUAL "-1")

option(WITH_STATIC_DEPENDENCIES "Restrict extensions and external dependencies to static libraries" OFF)
if(WITH_STATIC_DEPENDENCIES)
if(NOT POLICY CMP0065)
Expand Down

0 comments on commit 16bc6fd

Please sign in to comment.