summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2015-11-13 01:46:18 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2015-11-13 01:46:18 +0000
commit2cab8eec7423e8608f877a98b2a6879dd4fb5b6c (patch)
treeff5e7e41d34f219646a2748139a0d8e8a4a23505
parentfa5558307b31f9cb996a8e906b273800e68363f4 (diff)
downloadbcm5719-llvm-2cab8eec7423e8608f877a98b2a6879dd4fb5b6c.tar.gz
bcm5719-llvm-2cab8eec7423e8608f877a98b2a6879dd4fb5b6c.zip
[CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install destination of c-index-test and the libclang headers.
llvm-svn: 253001
-rw-r--r--clang/CMakeLists.txt18
-rw-r--r--clang/tools/c-index-test/CMakeLists.txt21
2 files changed, 31 insertions, 8 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 2a78c6ca909..bbc87510de3 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -462,14 +462,28 @@ 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
- DESTINATION include
+ 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/clang/tools/c-index-test/CMakeLists.txt b/clang/tools/c-index-test/CMakeLists.txt
index 87db20d7366..64efb1135f8 100644
--- a/clang/tools/c-index-test/CMakeLists.txt
+++ b/clang/tools/c-index-test/CMakeLists.txt
@@ -29,11 +29,20 @@ if (CLANG_HAVE_LIBXML)
target_link_libraries(c-index-test ${LIBXML2_LIBRARIES})
endif()
+if(INTERNAL_INSTALL_PREFIX)
+ set(INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/bin")
+else()
+ set(INSTALL_DESTINATION bin)
+endif()
+
install(TARGETS c-index-test
- RUNTIME DESTINATION bin
+ RUNTIME DESTINATION "${INSTALL_DESTINATION}"
COMPONENT c-index-test)
-add_custom_target(install-c-index-test
- DEPENDS c-index-test
- COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=c-index-test
- -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+
+if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's.
+ add_custom_target(install-c-index-test
+ DEPENDS c-index-test
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=c-index-test
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+endif()
OpenPOWER on IntegriCloud