r253001 - [CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install destination of c-index-test and the libclang headers.

Argyrios Kyrtzidis via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 17:46:18 PST 2015


Author: akirtzidis
Date: Thu Nov 12 19:46:18 2015
New Revision: 253001

URL: http://llvm.org/viewvc/llvm-project?rev=253001&view=rev
Log:
[CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install destination of c-index-test and the libclang headers.

Modified:
    cfe/trunk/CMakeLists.txt
    cfe/trunk/tools/c-index-test/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=253001&r1=253000&r2=253001&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Thu Nov 12 19:46:18 2015
@@ -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)

Modified: cfe/trunk/tools/c-index-test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/CMakeLists.txt?rev=253001&r1=253000&r2=253001&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/CMakeLists.txt (original)
+++ cfe/trunk/tools/c-index-test/CMakeLists.txt Thu Nov 12 19:46:18 2015
@@ -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()




More information about the cfe-commits mailing list