From: Matthias Maier Date: Fri, 11 Mar 2016 15:20:11 +0000 (-0600) Subject: CMake: Fix rpath handling on Mac OSX X-Git-Tag: v8.5.0-rc1~1228^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c780172d83f2728a7ca90074263d2112eff5e94;p=dealii.git CMake: Fix rpath handling on Mac OSX This forces global paths upon installation to avoid error messages like dyld: Library not loaded: /lib/libdeal_II.g.8.4.0-rc3.dylib Referenced from: /[...]/step-18 Reason: image not found In Reference to #1938 --- diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index c37b0e732b..b7bb5014b0 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2015 by the deal.II authors +## Copyright (C) 2012 - 2016 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -76,12 +76,20 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) LINKER_LANGUAGE "CXX" COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}" COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}}" - INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" ) + IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") + SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + PROPERTIES + MACOSX_RPATH OFF + BUILD_WITH_INSTALL_RPATH OFF + INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}" + ) + ENDIF() + # Under Windows (MSVC) cmake will always generate multi-configuration # projects. When building on the command line with 'cmake --build .', # release and debug builds of the library are done with the default 'Debug'