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.
This commit is contained in:
Stefan Brüns 2022-07-15 18:26:29 +02:00
parent 975414c2fe
commit 59d073639d
2 changed files with 3 additions and 1 deletions

View File

@ -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}")

View File

@ -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)