Blob Blame History Raw
From d093de8962ed6c2be914ebf8310ca9696b330469 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>
Date: Fri, 13 Jan 2023 10:50:57 +0000
Subject: [PATCH 4/6] Remove rpath

---
 cmake/ProcessOptions.cmake | 50 --------------------------------------
 1 file changed, 50 deletions(-)

diff --git a/cmake/ProcessOptions.cmake b/cmake/ProcessOptions.cmake
index fc4bd449d..21dbd8dc6 100644
--- a/cmake/ProcessOptions.cmake
+++ b/cmake/ProcessOptions.cmake
@@ -155,8 +155,6 @@ function( NEST_PROCESS_STATIC_LIBRARIES )
     endif ()
 
     set( BUILD_SHARED_LIBS OFF PARENT_SCOPE )
-    # set RPATH stuff
-    set( CMAKE_SKIP_RPATH TRUE PARENT_SCOPE )
 
     if ( UNIX OR APPLE )
       # On Linux .a is the static library suffix, on Mac OS X .lib can also
@@ -173,54 +171,6 @@ function( NEST_PROCESS_STATIC_LIBRARIES )
   else ()
     set( BUILD_SHARED_LIBS ON PARENT_SCOPE )
 
-    # set RPATH stuff
-    set( CMAKE_SKIP_RPATH FALSE PARENT_SCOPE )
-    # use, i.e. don't skip the full RPATH for the build tree
-    set( CMAKE_SKIP_BUILD_RPATH FALSE PARENT_SCOPE )
-    # on OS X
-    set( CMAKE_MACOSX_RPATH ON PARENT_SCOPE )
-
-    # when building, don't use the install RPATH already
-    # (but later on when installing)
-    set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE PARENT_SCOPE )
-
-    # set run-time search path (RPATH) so that dynamic libraries in ``lib/nest`` can be located
-
-    # Note: "$ORIGIN" (on Linux) and "@loader_path" (on MacOS) are not CMake variables, but special keywords for the
-    # Linux resp. the macOS dynamic loader. They refer to the path in which the object is located, e.g.
-    # ``${CMAKE_INSTALL_PREFIX}/bin`` for the nest and sli executables, ``${CMAKE_INSTALL_PREFIX}/lib/nest`` for all
-    # dynamic libraries except PyNEST (libnestkernel.so, etc.), and  something like
-    # ``${CMAKE_INSTALL_PREFIX}/lib/python3.x/site-packages/nest`` for ``pynestkernel.so``. The RPATH is relative to
-    # this origin, so the binary ``bin/nest`` can find the files in the relative location ``../lib/nest``, and
-    # similarly for PyNEST and the other libraries. For simplicity, we set all the possibilities on all generated
-    # objects.
-
-    # PyNEST can only act as an entry point; it does not need to be included in the other objects' RPATH itself.
-
-    if ( APPLE )
-      set( CMAKE_INSTALL_RPATH
-          # for binaries
-          "@loader_path/../${CMAKE_INSTALL_LIBDIR}/nest"
-          # for libraries (except pynestkernel)
-          "@loader_path/../../${CMAKE_INSTALL_LIBDIR}/nest"
-          # for pynestkernel: origin at <prefix>/lib/python3.x/site-packages/nest
-          "@loader_path/../../../nest"
-          PARENT_SCOPE )
-    else ()
-      set( CMAKE_INSTALL_RPATH
-          # for binaries
-          "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/nest"
-          # for libraries (except pynestkernel)
-          "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}/nest"
-          # for pynestkernel: origin at <prefix>/lib/python3.x/site-packages/nest
-          "\$ORIGIN/../../../nest"
-          PARENT_SCOPE )
-    endif ()
-
-    # add the automatically determined parts of the RPATH
-    # which point to directories outside the build tree to the install RPATH
-    set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE PARENT_SCOPE )
-
     if ( UNIX OR APPLE )
       # reverse the search order for lib extensions
       set( CMAKE_FIND_LIBRARY_SUFFIXES ".so;.dylib;.a;.lib" PARENT_SCOPE )
-- 
2.39.0