Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set RPATH if the the install prefix is a non-system location.

$ readelf -d /home/eradman/local/bin/io | grep RPATH
 0x0000000f (RPATH)                      Library rpath: [/home/eradman/local/lib]
$

$ readelf -d /usr/local/bin/io | grep RPATH
$

On UNIX this allows users to do a non-root install without setting LD_LIBRARY_PATH. Change lifted directly from http://www.vtk.org/Wiki/CMake_RPATH_handling
  • Loading branch information...
commit 50282aa760490cd345790a7c201007cd222f69aa 1 parent 4918d7e
@eradman eradman authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 tools/CMakeLists.txt
View
7 tools/CMakeLists.txt
@@ -7,6 +7,13 @@
# build both because we need the static binary to use our build
# system written in Io, before Io gets installed. Makes sense, eh?
+# Set RPATH if the the install prefix is a non-system location
+LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+IF("${isSystemDir}" STREQUAL "-1")
+ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ENDIF("${isSystemDir}" STREQUAL "-1")
+
+
# Some platform specific stuff. Do we have a sane popen? By sane
# we mean does it allow for a bidirectional pipe to be opened?
if(${CMAKE_SYSTEM_NAME} MATCHES "(Darwin|FreeBSD|NetBSD)")
Please sign in to comment.
Something went wrong with that request. Please try again.