X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1c877417a927ffd836782d38234f8a67cdf00917..63c371bbca5afccc4708761d83af6fc2443ca553:/tools/cmake/MakeLib.cmake diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index 7210bc7d98..0d157fe851 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -1,8 +1,14 @@ ### Make Libs -# On Mac OSX, don't specify where to look for the dependencies -# Otherwise, the libsimgrid-java will not find libsimgrid, as it is located in a temporary directory -set(MACOSX_RPATH OFF) +# On Mac OSX, specify that rpath is useful to look for the dependencies +# See https://cmake.org/Wiki/CMake_RPATH_handling and Java.cmake +set(MACOSX_RPATH ON) +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/.") + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +endif() ############################### # Declare the library content #