From 495e8908a00c2498d7c8b9cdab24a544da5bd59a Mon Sep 17 00:00:00 2001 From: Matthieu Volat Date: Fri, 8 Jun 2018 16:11:53 +0200 Subject: [PATCH] Fix OSX rpath issues by using real paths. 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 | 4 ++-- tools/cmake/Tests.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index c86e84604a..c72e6d5e28 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -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() ############################### diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index fe303dfe45..36fe2fef83 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -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") -- 2.20.1