[PATCH v3 1/1] Set RPATH of installed libs and binaries

Jan Vesely jan.vesely at rutgers.edu
Thu Dec 19 15:04:00 PST 2013


v2: Use $ORIGIN relative path
v3: Always set the RPAHT variable, let CMAKE_SKIP_INSTALL_RPATH decide whether
it's used.

Based on:
http://www.cmake.org/Wiki/CMake_RPATH_handling#Recommendations

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---

Hi,

this is the final one-liner patch. I don't have commit access so feel free
to push it.

regards,
Jan

 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4674338..cf0faa7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -411,6 +411,8 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
 set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
 set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
 
+set( CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
+
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR})
-- 
1.8.3.1




More information about the llvm-commits mailing list