File 0001-Fix-netgen-executable-and-library-RUNPATHs.patch of Package netgen
From 201f2b3dd0a213ea2d825c53b71d7344ca6947a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
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 binary directories.
The libraries are all located in the same directory, so just use "$ORIGIN"
for these.
---
CMakeLists.txt | 2 +-
ng/CMakeLists.txt | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d98b324..1435a8e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,7 +194,7 @@ 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}")
+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 3ad3d8be..2c980065 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)
--
2.37.0