From 59d073639d80dd743b51d878fdfe7dab3bc5bd78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Fri, 15 Jul 2022 18:26:29 +0200 Subject: [PATCH] Fix netgen executable and library RUNPATHs netgen defaults to the CMAKE_INSTALL_RPATH, which includes "$ORIGIN", i.e. the BINDIR, but it should only point to the library directories. The libraries are all located in the same directory, so just use "$ORIGIN" for these. --- CMakeLists.txt | 3 ++- ng/CMakeLists.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c54e30e..c78c49ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,7 +207,8 @@ set(NG_INSTALL_DIR EXPORT netgen-targets RUNTIME DESTINATION ${NG_INSTALL_DIR_BI install(EXPORT netgen-targets DESTINATION ${NG_INSTALL_DIR_CMAKE} COMPONENT netgen_devel) set(CMAKE_MACOSX_RPATH TRUE) -set(CMAKE_INSTALL_RPATH "${NG_RPATH_TOKEN};${NG_RPATH_TOKEN}/${NETGEN_RPATH}") +# Default RPATH used for all libraries +set(CMAKE_INSTALL_RPATH "${NG_RPATH_TOKEN}") if(BUILD_FOR_CONDA) file(RELATIVE_PATH py_rpath "/bin" "/${NG_INSTALL_DIR_LIB}") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${py_rpath}") diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt index b5a1985b..7db7c335 100644 --- a/ng/CMakeLists.txt +++ b/ng/CMakeLists.txt @@ -24,6 +24,7 @@ if(USE_GUI) target_sources(netgen PRIVATE ../windows/netgen.rc) endif(WIN32) target_link_libraries( netgen nglib nggui netgen_python netgen_gui) + set_target_properties( netgen PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/${NETGEN_RPATH}") install(TARGETS netgen ${NG_INSTALL_DIR}) if(APPLE) set_target_properties(netgen PROPERTIES OUTPUT_NAME netgen)