Commit 88eaa59a authored by Christophe Geuzaine's avatar Christophe Geuzaine

try moving the RPATH stuff lower

parent 3ad33113
Pipeline #2268 canceled with stage
in 8 minutes and 51 seconds
......@@ -5,31 +5,6 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
# KHModif -- 7 August 2018
# make sure that dynamic libraries can be found when installing/
# displacing the binaries
# from http://www.cmake.org/Wiki/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")
# end KHModif
# do not warn about non-definition of WIN32 on Cygwin
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
......@@ -256,6 +231,29 @@ 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(MSVC)
# remove annoying warning about bool/int cast performance
set(GMSH_CONFIG_PRAGMAS "#pragma warning(disable:4800 4244 4267)")
......
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