[libcxx] r307615 - [libcxx][CMake] Add install path variable to allow overriding the destination
Petr Hosek via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 10 19:39:50 PDT 2017
Author: phosek
Date: Mon Jul 10 19:39:50 2017
New Revision: 307615
URL: http://llvm.org/viewvc/llvm-project?rev=307615&view=rev
Log:
[libcxx][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/D33762
Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/docs/BuildingLibcxx.rst
libcxx/trunk/include/CMakeLists.txt
libcxx/trunk/lib/CMakeLists.txt
Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=307615&r1=307614&r2=307615&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Mon Jul 10 19:39:50 2017
@@ -352,6 +352,13 @@ else()
endif()
file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
+set(LIBCXX_INSTALL_PREFIX "" CACHE STRING
+ "Define libc++ destination prefix.")
+
+if (NOT LIBCXX_INSTALL_PREFIX MATCHES "^$|.*/")
+ message(FATAL_ERROR "LIBCXX_INSTALL_PREFIX has to end with \"/\".")
+endif()
+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=307615&r1=307614&r2=307615&view=diff
==============================================================================
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Mon Jul 10 19:39:50 2017
@@ -55,7 +55,7 @@ macro(setup_abi_lib abidefines abilib ab
)
if (LIBCXX_INSTALL_HEADERS)
install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
- DESTINATION include/c++/v1/${dstdir}
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir}
COMPONENT libcxx
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
Modified: libcxx/trunk/docs/BuildingLibcxx.rst
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/BuildingLibcxx.rst?rev=307615&r1=307614&r2=307615&view=diff
==============================================================================
--- libcxx/trunk/docs/BuildingLibcxx.rst (original)
+++ libcxx/trunk/docs/BuildingLibcxx.rst Mon Jul 10 19:39:50 2017
@@ -216,6 +216,11 @@ libc++ specific options
Extra suffix to append to the directory where libraries are to be installed.
This option overrides `LLVM_LIBDIR_SUFFIX`.
+.. option:: LIBCXX_INSTALL_PREFIX:STRING
+
+ **Default**: ``""``
+
+ Define libc++ destination prefix.
.. _libc++experimental options:
Modified: libcxx/trunk/include/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/CMakeLists.txt?rev=307615&r1=307614&r2=307615&view=diff
==============================================================================
--- libcxx/trunk/include/CMakeLists.txt (original)
+++ libcxx/trunk/include/CMakeLists.txt Mon Jul 10 19:39:50 2017
@@ -20,7 +20,7 @@ endif()
if (LIBCXX_INSTALL_HEADERS)
install(DIRECTORY .
- DESTINATION include/c++/v1
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
COMPONENT cxx-headers
FILES_MATCHING
${LIBCXX_HEADER_PATTERN}
@@ -44,7 +44,7 @@ if (LIBCXX_INSTALL_HEADERS)
set(generated_config_deps generate_config_header)
# Install the generated header as __config.
install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
- DESTINATION include/c++/v1
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
RENAME __config
COMPONENT cxx-headers)
Modified: libcxx/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=307615&r1=307614&r2=307615&view=diff
==============================================================================
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Mon Jul 10 19:39:50 2017
@@ -355,8 +355,8 @@ if (LIBCXX_INSTALL_LIBRARY)
set(experimental_lib cxx_experimental)
endif()
install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
- LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
- ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
+ LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
+ ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
)
# NOTE: This install command must go after the cxx install command otherwise
# it will not be executed after the library symlinks are installed.
@@ -364,7 +364,7 @@ if (LIBCXX_INSTALL_LIBRARY)
# Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
# after we required CMake 3.0.
install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
- DESTINATION lib${LIBCXX_LIBDIR_SUFFIX}
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX}
COMPONENT libcxx)
endif()
endif()
More information about the cfe-commits
mailing list