summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2015-03-27 16:53:06 +0000
committerDerek Schuff <dschuff@google.com>2015-03-27 16:53:06 +0000
commitef9928e35714272b41f48231dac507c68db2c637 (patch)
treef4754f44c6097f0a2ed6bab1bdf07fce1ee4ef51 /llvm/cmake/modules
parent3082d0e9845120b541b47179e7543177e517de04 (diff)
downloadbcm5719-llvm-ef9928e35714272b41f48231dac507c68db2c637.tar.gz
bcm5719-llvm-ef9928e35714272b41f48231dac507c68db2c637.zip
CMake: enable installing utils
Added a new boolean CMake flag, LLVM_INSTALL_UTILS. When set, the 'install' target will include in the bin directory the utils binaries - e.g. FileCheck. This mirrors the autoconfig behavior. Test Plan: Locally verified that utils binaries are copied when flag is set, and not copied when flag is not set. Reviewers: jfb, dschuff, beanz Reviewed By: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8587 Patch by Mircea Trofin llvm-svn: 233385
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 50cee302d0e..1bb98a14d49 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -547,6 +547,18 @@ endmacro(add_llvm_example name)
macro(add_llvm_utility name)
add_llvm_executable(${name} ${ARGN})
set_target_properties(${name} PROPERTIES FOLDER "Utils")
+ if( LLVM_INSTALL_UTILS )
+ install (TARGETS ${name}
+ RUNTIME DESTINATION bin
+ COMPONENT ${name})
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(install-${name}
+ DEPENDS ${name}
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=${name}
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ endif()
+ endif()
endmacro(add_llvm_utility name)
OpenPOWER on IntegriCloud