summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-07-11 01:42:26 +0000
committerPetr Hosek <phosek@chromium.org>2017-07-11 01:42:26 +0000
commit1f8318f57fe94a1e6e6667be2b2f2c74375c7a08 (patch)
tree523406e7bf3d709aef5e519cce5017123fa63b50
parentc3926621b0d7904282728696bfe5b5a804b064c1 (diff)
[libcxxabi][CMake] Add install path variable to allow overriding the destination
This is going to be used by the runtime build in the multi-target setup to allow using different install prefix for each target. Differential Revision: https://reviews.llvm.org/D33761 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@307611 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt7
-rw-r--r--src/CMakeLists.txt4
2 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b3733d..99d4634 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,13 @@ else()
set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
endif()
+set(LIBCXXABI_INSTALL_PREFIX "" CACHE STRING
+ "Define libc++abi destination prefix.")
+
+if (NOT LIBCXXABI_INSTALL_PREFIX MATCHES "^$|.*/")
+ message(FATAL_ERROR "LIBCXXABI_INSTALL_PREFIX has to end with \"/\".")
+endif()
+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ff47ed3..adcc412 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -174,8 +174,8 @@ endif()
add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS})
install(TARGETS ${LIBCXXABI_TARGETS}
- LIBRARY DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
- ARCHIVE DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
+ LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
+ ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
)
if (NOT CMAKE_CONFIGURATION_TYPES)