Use relative rpath so that the installation and build dirs are relocatable.
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! llvm-svn: 201921
This commit is contained in:
parent
0dc28ea301
commit
03bb9e183a
|
|
@ -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_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( NOT DEFINED CMAKE_INSTALL_RPATH )
|
||||
endif()
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue