Skip to content

Commit 59d0736

Browse files
committed
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.
1 parent 975414c commit 59d0736

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ set(NG_INSTALL_DIR EXPORT netgen-targets RUNTIME DESTINATION ${NG_INSTALL_DIR_BI
207207
install(EXPORT netgen-targets DESTINATION ${NG_INSTALL_DIR_CMAKE} COMPONENT netgen_devel)
208208

209209
set(CMAKE_MACOSX_RPATH TRUE)
210-
set(CMAKE_INSTALL_RPATH "${NG_RPATH_TOKEN};${NG_RPATH_TOKEN}/${NETGEN_RPATH}")
210+
# Default RPATH used for all libraries
211+
set(CMAKE_INSTALL_RPATH "${NG_RPATH_TOKEN}")
211212
if(BUILD_FOR_CONDA)
212213
file(RELATIVE_PATH py_rpath "/bin" "/${NG_INSTALL_DIR_LIB}")
213214
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${py_rpath}")

ng/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if(USE_GUI)
2424
target_sources(netgen PRIVATE ../windows/netgen.rc)
2525
endif(WIN32)
2626
target_link_libraries( netgen nglib nggui netgen_python netgen_gui)
27+
set_target_properties( netgen PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/${NETGEN_RPATH}")
2728
install(TARGETS netgen ${NG_INSTALL_DIR})
2829
if(APPLE)
2930
set_target_properties(netgen PROPERTIES OUTPUT_NAME netgen)

0 commit comments

Comments
 (0)