X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/88fad0aaff9eb463f048bfdfe4ad6218aba44ddb..db1df4b379b3e088b50f6e573ba9b0887b59c96a:/tools/cmake/MakeLib.cmake diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index 66886a7ce2..c72e6d5e28 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -1,16 +1,16 @@ ### 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 -set(MACOSX_RPATH ON) +# See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling and Java.cmake +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 set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # When executing from build tree, take the lib from the system 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() ############################### @@ -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() @@ -68,7 +69,7 @@ if(HAVE_GRAPHVIZ) endif() endif() -if(SIMGRID_HAVE_MC AND HAVE_GNU_LD AND NOT ${DL_LIBRARY} STREQUAL "") +if(SIMGRID_HAVE_MC AND NOT ${DL_LIBRARY} STREQUAL "") SET(SIMGRID_DEP "${SIMGRID_DEP} ${DL_LIBRARY}") 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)