Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Use relative rpath so that the installation and build dirs are reloca…
Browse files Browse the repository at this point in the history
…table.

This works by asking cmake to use the "install rpath", but setting that rpath
to be relative.

Thanks a lot to Brad King for the help with CMake!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201921 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Feb 22, 2014
1 parent 341149a commit c94f3ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Expand Up @@ -423,9 +423,13 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )

if( NOT DEFINED CMAKE_INSTALL_RPATH )
set( CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
endif( NOT DEFINED CMAKE_INSTALL_RPATH )
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
if (APPLE)
set(CMAKE_INSTALL_NAME_DIR "@rpath")
set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
else(UNIX)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand Down

0 comments on commit c94f3ae

Please sign in to comment.