Skip to content

Commit 7e3c1f4

Browse files
committed
[CMake] set INSTALL_RPATH for python on linux
To avoid the need to set `LD_LIBRARY_PATH` when the `CMAKE_INSTALL_PREFIX` is not a standard one.
1 parent 99454d6 commit 7e3c1f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014-2020 CNRS INRIA
2+
# Copyright (c) 2014-2021 CNRS INRIA
33
#
44

55
# --- LIBRARY --- #
@@ -33,6 +33,10 @@ SET_TARGET_PROPERTIES(${PYWRAP}
3333
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${PROJECT_NAME}"
3434
)
3535

36+
IF(UNIX AND NOT APPLE)
37+
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES INSTALL_RPATH "\$ORIGIN/../../..")
38+
ENDIF()
39+
3640
INSTALL(TARGETS ${PYWRAP} DESTINATION ${${PYWRAP}_INSTALL_DIR})
3741

3842
# --- INSTALL SCRIPTS

0 commit comments

Comments
 (0)