For this to works across all tests, tuto-msg must be supplied
-Wl,-rpath argument to CFLAGS, not elegant, but works...
# 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
# 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()
###############################
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")