Revision: 77757
          http://sourceforge.net/p/brlcad/code/77757
Author:   starseeker
Date:     2020-11-20 15:34:53 +0000 (Fri, 20 Nov 2020)
Log Message:
-----------
Try install_name_tool instead of file(RPATH_CHANGE) - however, it looks like 
the final rpath still isn't being successfully applied?

Modified Paths:
--------------
    brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake

Modified: 
brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
===================================================================
--- brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake   
2020-11-20 14:29:01 UTC (rev 77756)
+++ brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake   
2020-11-20 15:34:53 UTC (rev 77757)
@@ -63,6 +63,7 @@
   if (CMAKE_CONFIGURATION_TYPES)
     add_custom_command(
       OUTPUT "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${rdir}/${tfile}"
+      COMMAND ls -lR ${CMAKE_BINARY_DIR}
       COMMAND ${CMAKE_COMMAND} -DFTYPE=${ftype} -DSRC=${root}/${rdir}/${ofile} 
-DDEST=${CMAKE_BINARY_DIR}/$<CONFIG>/${rdir}/${tfile} -P 
"${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake"
       DEPENDS ${extproj}
       )
@@ -270,15 +271,29 @@
   endif (NOT DEFINED CMAKE_BUILD_RPATH)
   # Note - proper quoting for install(CODE) is extremely important for CPack, 
see
   # https://stackoverflow.com/a/48487133
-  install(CODE "
-  message(\"OLD_RPATH: ${CMAKE_BUILD_RPATH}\")
-  message(\"NEW_RPATH: ${NEW_RPATH}\")
-  execute_process(COMMAND otool -l \${CMAKE_INSTALL_PREFIX}/${OFILE})
-  file(RPATH_CHANGE
-    FILE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OFILE}\"
-    OLD_RPATH \"${CMAKE_BUILD_RPATH}\"
-    NEW_RPATH \"${NEW_RPATH}\")
-  ")
+  if (APPLE)
+    install(CODE "
+    message(\"OLD_RPATH: ${CMAKE_BUILD_RPATH}\")
+    message(\"NEW_RPATH: ${NEW_RPATH}\")
+    set(WPATH \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OFILE}\")
+    execute_process(COMMAND ls -l \${CMAKE_INSTALL_PREFIX}/${OFILE})
+    execute_process(COMMAND chmod u+w \${CMAKE_INSTALL_PREFIX}/${OFILE})
+    execute_process(COMMAND ls -l \${CMAKE_INSTALL_PREFIX}/${OFILE})
+    execute_process(COMMAND otool -l \"\${WPATH}\" OUTPUT_VARIABLE OTOOL_OUT)
+    message(\"OTOOL_OUT: \${OTOOL_OUT}\")
+    message(\"install_name_tool -change ${CMAKE_BUILD_RPATH} ${NEW_RPATH} 
\${WPATH}\")
+    execute_process(COMMAND install_name_tool -change \"${CMAKE_BUILD_RPATH}\" 
\"${NEW_RPATH}\" \"\${WPATH}\")
+    execute_process(COMMAND otool -l \"\${WPATH}\" OUTPUT_VARIABLE OTOOL_OUT2)
+    message(\"OTOOL_OUT2: \${OTOOL_OUT2}\")
+    ")
+  else (APPLE)
+    install(CODE "
+    file(RPATH_CHANGE
+      FILE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OFILE}\"
+      OLD_RPATH \"${CMAKE_BUILD_RPATH}\"
+      NEW_RPATH \"${NEW_RPATH}\")
+    ")
+  endif (APPLE)
 endfunction(ET_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