From 4497e3a1e6906d231d2e7997f015745c06b10c08 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 29 Apr 2016 22:17:15 +0000 Subject: [PATCH] [CMake] Create a separate install target for libcxx headers This change doesn't impact the behavior of the install-libcxx target which installs whichever libcxx components you build, it just adds a separate target to just install the headers. llvm-svn: 268124 --- libcxx/include/CMakeLists.txt | 14 ++++++++++++-- libcxx/lib/CMakeLists.txt | 5 ++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt index e16dc8b..6484289 100644 --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -19,7 +19,7 @@ file(COPY . if (LIBCXX_INSTALL_HEADERS) install(DIRECTORY . DESTINATION include/c++/v1 - COMPONENT libcxx + COMPONENT libcxx-headers FILES_MATCHING ${LIBCXX_HEADER_PATTERN} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ @@ -46,7 +46,17 @@ if (LIBCXX_INSTALL_HEADERS) DESTINATION include/c++/v1 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ RENAME __config - COMPONENT libcxx) + COMPONENT libcxx-headers) + endif() + + if (NOT CMAKE_CONFIGURATION_TYPES) + # this target is just needed as a placeholder for the distribution target + add_custom_target(libcxx-headers) + add_custom_target(install-libcxx-headers + DEPENDS ${name} libcxx-headers + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=libcxx-headers + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index 3e3c47f..d442875 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -180,8 +180,11 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR if(LIBCXX_INSTALL_LIBRARY) set(deps DEPENDS cxx) endif() + if(LIBCXX_INSTALL_HEADERS) + set(deps DEPENDS install-libcxx-headers) + endif() add_custom_target(install-libcxx - ${deps} + ${deps} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=libcxx -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake") -- 2.7.4