Revision: 77380
          http://sourceforge.net/p/brlcad/code/77380
Author:   starseeker
Date:     2020-10-09 14:01:53 +0000 (Fri, 09 Oct 2020)
Log Message:
-----------
Hmm.  Multi-Config is going to be a problem for Tcl and other non-CMake 
builds...

Modified Paths:
--------------
    brlcad/branches/thirdparty_rework/src/superbuild/CMake/RPath_Setup.cmake

Modified: 
brlcad/branches/thirdparty_rework/src/superbuild/CMake/RPath_Setup.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/CMake/RPath_Setup.cmake    
2020-10-09 13:29:51 UTC (rev 77379)
+++ brlcad/branches/thirdparty_rework/src/superbuild/CMake/RPath_Setup.cmake    
2020-10-09 14:01:53 UTC (rev 77380)
@@ -35,7 +35,7 @@
 # function to hide the details from other code.
 function(relative_rpath outvar)
 
-  cmake_parse_arguments(R "" "SUFFIX" "" ${ARGN})
+  cmake_parse_arguments(R "" "SUFFIX;LEN" "" ${ARGN})
 
   if (R_SUFFIX)
     set(DPATH)
@@ -49,11 +49,24 @@
   endif (R_SUFFIX)
 
   if (APPLE)
-    set(${outvar} ";@loader_path/${DPATH}${LIB_DIR}" PARENT_SCOPE)
+    set(RELATIVE_RPATH ";@loader_path/${DPATH}${LIB_DIR}" PARENT_SCOPE)
   else (APPLE)
-    set(${outvar} ":\$ORIGIN/${DPATH}${LIB_DIR}" PARENT_SCOPE)
+    set(RELATIVE_RPATH ":\$ORIGIN/${DPATH}${LIB_DIR}" PARENT_SCOPE)
   endif (APPLE)
 
+  # IFF the caller tells us to, lengthen the relative path to a
+  # specified length.  This is useful in scenarios where the relative
+  # path is the only viable option
+  if (R_LEN)
+    string(LENGTH "${RELATIVE_RPATH}" CURR_LEN)
+    while("${CURR_LEN}" LESS "${R_LEN}")
+      set(RELATIVE_RPATH "${RELATIVE_RPATH}:")
+      string(LENGTH "${RELATIVE_RPATH}" CURR_LEN)
+    endwhile("${CURR_LEN}" LESS "${R_LEN}")
+  endif (R_LEN)
+
+  set(${outvar} "${RELATIVE_RPATH}" PARENT_SCOPE)
+
 endfunction(relative_rpath)
 
 # Set (or restore) a standard BRL-CAD setting for CMAKE_BUILD_RPATH.

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to