From 67d48d358f75d5e56d3cd41694e17ca880d4f42e Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Wed, 15 Nov 2023 21:13:00 +0100 Subject: [PATCH] Preserve link path when installing the shared library generated with nanobind --- rbnicsx/_cpp/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/rbnicsx/_cpp/CMakeLists.txt b/rbnicsx/_cpp/CMakeLists.txt index d6880d6..da832c5 100644 --- a/rbnicsx/_cpp/CMakeLists.txt +++ b/rbnicsx/_cpp/CMakeLists.txt @@ -75,4 +75,5 @@ target_include_directories(rbnicsx_cpp PRIVATE ${PETSC4PY_INCLUDE_DIR}) target_link_libraries(rbnicsx_cpp PRIVATE PkgConfig::PETSC) # Install the compiled library to the _cpp subdirectory +set_target_properties(rbnicsx_cpp PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) install(TARGETS rbnicsx_cpp LIBRARY DESTINATION rbnicsx/_cpp)