diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b8f3529af45ea4647b52bf972ea4419b1c06c88..eaa31273a100a2344da1ec8ed30cb873e030df39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,7 @@ set(${PROJECT_NAME}_SOURCES add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS}) target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>) target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include/qrw>) +set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "\$ORIGIN") #Â Include Eigen3 directories TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR}) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 7ae6e048d53830656660ef370037264a8b7fbe61..0ad40cf886abe4a986b8f4b07a8fb8783125d6fa 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -5,7 +5,9 @@ set(${PY_NAME}_SOURCES add_library(${PY_NAME} SHARED ${${PY_NAME}_SOURCES}) target_link_libraries(${PY_NAME} PUBLIC ${PROJECT_NAME} ${PYTHON_LIBRARY} eigenpy::eigenpy) target_include_directories(${PY_NAME} SYSTEM PRIVATE ${PYTHON_INCLUDE_DIRS}) -set_target_properties(${PY_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PY_NAME}) +set_target_properties(${PY_NAME} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PY_NAME} + INSTALL_RPATH "\$ORIGIN/../../../..") TARGET_LINK_BOOST_PYTHON(${PY_NAME} PUBLIC) install(TARGETS ${PY_NAME} DESTINATION ${${PY_NAME}_INSTALL_DIR})