[PATCH] D46521: [llvm] cmake: resolve symlinks in LLVMConfig.cmake
Peter Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 7 06:01:13 PDT 2018
Lekensteyn created this revision.
Lekensteyn added a reviewer: sylvestre.ledru.
Herald added subscribers: llvm-commits, mgorny.
Ensure that symlinks such as /usr/lib/llvm-X.Y/cmake (pointing to
lib/cmake/llvm) are resolved. This ensures that LLVM_INSTALL_PREFIX
becomes /usr/lib/llvm-X.Y instead of /usr.
Partially addresses PR37128
Repository:
rL LLVM
https://reviews.llvm.org/D46521
Files:
cmake/modules/CMakeLists.txt
Index: cmake/modules/CMakeLists.txt
===================================================================
--- cmake/modules/CMakeLists.txt
+++ cmake/modules/CMakeLists.txt
@@ -76,10 +76,10 @@
# Generate LLVMConfig.cmake for the install tree.
set(LLVM_CONFIG_CODE "
# Compute the installation prefix from this LLVMConfig.cmake file location.
-get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
+get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
# Construct the proper number of get_filename_component(... PATH)
# calls to compute the installation prefix.
-string(REGEX REPLACE "/" ";" _count "${LLVM_INSTALL_PACKAGE_DIR}")
+string(REGEX REPLACE "/" ";" _count "prefix/${LLVM_INSTALL_PACKAGE_DIR}")
foreach(p ${_count})
set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46521.145450.patch
Type: text/x-patch
Size: 916 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180507/c143983a/attachment.bin>
More information about the llvm-commits
mailing list