Commit 24cdefd3 authored by Christophe Geuzaine's avatar Christophe Geuzaine

don't use the new RPATH options on Mac - they don't work. Let's see how it works on Linux/Windows.

parent 88eaa59a
Pipeline #2269 passed with stage
in 66 minutes 47 seconds
......@@ -231,28 +231,33 @@ if(ENABLE_BUILD_DYNAMIC)
set(GMSH_OS "${GMSH_OS}-sdk")
endif(ENABLE_BUILD_DYNAMIC)
# make sure that dynamic libraries can be found when installing/ displacing the
# binaries: from https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/
# RPATH-handling:
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already (but later on when
# installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH which point to directories
# outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib"
isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../lib")
ENDIF("${isSystemDir}" STREQUAL "-1")
if(APPLE)
# FIXME: change this once we understand rpaths - the options below do not work
set(CMAKE_MACOSX_RPATH 0)
else(APPLE)
# make sure that dynamic libraries can be found when installing/ displacing the
# binaries: from https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/
# RPATH-handling:
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already (but later on when
# installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH which point to
# directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib"
isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../lib")
endif("${isSystemDir}" STREQUAL "-1")
endif(APPLE)
if(MSVC)
# remove annoying warning about bool/int cast performance
......@@ -1514,10 +1519,6 @@ endif(ENABLE_BUILD_LIB)
# shared library target
if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
if(APPLE)
# FIXME: change this once we understand rpaths
set(CMAKE_MACOSX_RPATH 0)
endif(APPLE)
if(WIN32 OR CYGWIN)
add_definitions(-DGMSH_DLL)
endif(WIN32 OR CYGWIN)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment