diff options
-rw-r--r-- | llvm/CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 29eb0016840..3db1d275014 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -766,3 +766,20 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() + +# This must be at the end of the LLVM root CMakeLists file because it must run +# after all targets are created. +if(LLVM_DISTRIBUTION_COMPONENTS) + if(CMAKE_CONFIGURATION_TYPES) + message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)") + endif() + + add_custom_target(install-distribution) + foreach(target ${LLVM_DISTRIBUTION_COMPONENTS}) + if(TARGET install-${target}) + add_dependencies(install-distribution install-${target}) + else() + message(FATAL_ERROR "Specified distribution component '${target}' doesn't have an install target") + endif() + endforeach() +endif() |