]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Fix rpath handling on Mac OSX 2337/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 11 Mar 2016 15:20:11 +0000 (09:20 -0600)
committerTimo Heister <timo.heister@gmail.com>
Fri, 11 Mar 2016 16:17:03 +0000 (11:17 -0500)
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

source/CMakeLists.txt

index c37b0e732b36fb7706d0fa4913bcadcd26fe88c4..b7bb5014b0757f5efc88bf0a5ca917317e046d59 100644 (file)
@@ -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'

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.