Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix OSX rpath issues by using real paths.
authorMatthieu Volat <matthieu.volat@univ-lyon1.fr>
Fri, 8 Jun 2018 14:11:53 +0000 (16:11 +0200)
committerMatthieu Volat <matthieu.volat@univ-lyon1.fr>
Fri, 8 Jun 2018 14:11:53 +0000 (16:11 +0200)
For this to works across all tests, tuto-msg must be supplied
-Wl,-rpath argument to CFLAGS, not elegant, but works...

tools/cmake/MakeLib.cmake
tools/cmake/Tests.cmake

index c86e846..c72e6d5 100644 (file)
@@ -2,7 +2,7 @@
 
 # On Mac OSX, specify that rpath is useful to look for the dependencies
 # See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling and Java.cmake
-set(MACOSX_RPATH ON)
+set(CMAKE_MACOSX_RPATH TRUE)
 if(APPLE)
   SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # When installed, use system path
   set(CMAKE_SKIP_BUILD_RPATH FALSE)         #¬†When executing from build tree, take the lib from the build path if exists
@@ -10,7 +10,7 @@ if(APPLE)
 
   # add the current location of libsimgrid-java.dynlib as a location for libsimgrid.dynlib
   # (useful when unpacking the native libraries from the jarfile)
-  set(CMAKE_INSTALL_RPATH "@loader_path/.;@rpath/.")
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
 endif()
 
 ###############################
index fe303df..36fe2fe 100644 (file)
@@ -112,7 +112,7 @@ if((NOT enable_memcheck) AND (NOT enable_address_sanitizer) AND (NOT enable_unde
   set(tuto-src-path "${CMAKE_SOURCE_DIR}/doc/tuto-msg")
   set(tuto-bin-path "${CMAKE_BINARY_DIR}/doc/tuto-msg")
   set(tuto-platform-file "${CMAKE_SOURCE_DIR}/examples/platforms/small_platform.xml")
-  set(tuto-make "make -C ${tuto-bin-path} CC=${CMAKE_C_COMPILER} EXTRA_CFLAGS=\"-I${CMAKE_SOURCE_DIR}/include -I${CMAKE_BINARY_DIR}/include -L${CMAKE_BINARY_DIR}/lib\"")
+  set(tuto-make "make -C ${tuto-bin-path} CC=${CMAKE_C_COMPILER} EXTRA_CFLAGS=\"-I${CMAKE_SOURCE_DIR}/include -I${CMAKE_BINARY_DIR}/include -L${CMAKE_BINARY_DIR}/lib -Wl,-rpath ${CMAKE_BINARY_DIR}/lib\"")
   ADD_TEST(tuto-msg-clean sh -xc "${tuto-make} clean")
   ADD_TEST(tuto-msg-0 sh -xc "${tuto-make} masterworker      && ${tuto-bin-path}/masterworker      ${tuto-platform-file} ${tuto-src-path}/deployment0.xml")
   ADD_TEST(tuto-msg-1 sh -xc "${tuto-make} masterworker-sol1 && ${tuto-bin-path}/masterworker-sol1 ${tuto-platform-file} ${tuto-src-path}/deployment1.xml")