Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to fix how we deal with rpath on binaries
[simgrid.git] / tools / cmake / MakeLib.cmake
index b6af7e7..c86e846 100644 (file)
@@ -1,7 +1,7 @@
 ### Make Libs
 
 # On Mac OSX, specify that rpath is useful to look for the dependencies
-# See https://cmake.org/Wiki/CMake_RPATH_handling and Java.cmake
+# See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling and Java.cmake
 set(MACOSX_RPATH ON)
 if(APPLE)
   SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # When installed, use system path
@@ -33,7 +33,8 @@ if(enable_model-checking)
                         PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
   set_property(TARGET simgrid-mc
                APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
-
+  install(TARGETS simgrid-mc # install that binary without breaking the rpath on Mac
+    RUNTIME DESTINATION bin/)      
 endif()
 
 
@@ -91,6 +92,8 @@ if(enable_smpi)
   target_link_libraries(smpimain simgrid)
   set_target_properties(smpimain
     PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+  install(TARGETS smpimain # install that binary without breaking the rpath on Mac
+    RUNTIME DESTINATION bin/)      
 endif()
 
 if(enable_smpi AND APPLE)