From: Chris Bieneman Date: Thu, 14 Jan 2016 22:48:45 +0000 (+0000) Subject: [CMake] Move the install logic for libclang's headers into the libclang CMakelists X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fa4bacd11f4d0e2706dabf2348134151284650c;p=clang [CMake] Move the install logic for libclang's headers into the libclang CMakelists This makes it so if you disable building libclang you won't install the headers as part of the 'install' target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257828 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d8e98c43e0..5482017029 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -475,28 +475,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) ) endif() -if(INTERNAL_INSTALL_PREFIX) - set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") -else() - set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) -endif() - -install(DIRECTORY include/clang-c - COMPONENT libclang-headers - DESTINATION "${LIBCLANG_HEADERS_INSTALL_DESTINATION}" - FILES_MATCHING - PATTERN "*.h" - PATTERN ".svn" EXCLUDE - ) - -if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. - add_custom_target(install-libclang-headers - DEPENDS - COMMAND "${CMAKE_COMMAND}" - -DCMAKE_INSTALL_COMPONENT=libclang-headers - -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") -endif() - add_definitions( -D_GNU_SOURCE ) option(CLANG_ENABLE_ARCMT "Build ARCMT." ON) diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt index 5267c02db5..d7eaca1094 100644 --- a/tools/libclang/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt @@ -115,3 +115,25 @@ if(ENABLE_SHARED) DEFINE_SYMBOL _CINDEX_LIB_) endif() endif() + +if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") +else() + set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) +endif() + +install(DIRECTORY ../../include/clang-c + COMPONENT libclang-headers + DESTINATION "${LIBCLANG_HEADERS_INSTALL_DESTINATION}" + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + +if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. + add_custom_target(install-libclang-headers + DEPENDS + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=libclang-headers + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") +endif()