From 0158e53ab535128e14b9bbea3326ef30cb70676f Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 9 Jun 2016 22:41:36 +0000 Subject: [PATCH] [CMake] Cleanup ExternalProject usage of CMake 3.x features All the ExternalProject features in use here are supported by CMake 3.4.3, so we don't need these version checks anymore. llvm-svn: 272327 --- cmake/modules/LLVMExternalProjectUtils.cmake | 26 ++++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/cmake/modules/LLVMExternalProjectUtils.cmake b/cmake/modules/LLVMExternalProjectUtils.cmake index bf1b152b275..2b77ff3bcdf 100644 --- a/cmake/modules/LLVMExternalProjectUtils.cmake +++ b/cmake/modules/LLVMExternalProjectUtils.cmake @@ -61,20 +61,6 @@ function(llvm_ExternalProject_Add name source_dir) list(APPEND TOOLCHAIN_BINS ${RUNTIME_LIBRARIES}) endif() - if(CMAKE_VERSION VERSION_GREATER 3.1.0) - set(cmake_3_1_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL 1) - set(cmake_3_1_BUILD_ALWAYS BUILD_ALWAYS 1) - endif() - - if(CMAKE_VERSION VERSION_GREATER 3.3.20150708) - set(cmake_3_4_USES_TERMINAL_OPTIONS - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 - ) - set(cmake_3_4_USES_TERMINAL USES_TERMINAL 1) - endif() - set(STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/${name}-stamps/) set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${name}-bins/) @@ -117,7 +103,7 @@ function(llvm_ExternalProject_Add name source_dir) DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}-clobber-stamp) if(ARG_EXCLUDE_FROM_ALL) - set(exclude ${cmake_3_1_EXCLUDE_FROM_ALL}) + set(exclude EXCLUDE_FROM_ALL 1) endif() ExternalProject_Add(${name} @@ -135,8 +121,10 @@ function(llvm_ExternalProject_Add name source_dir) ${PASSTHROUGH_VARIABLES} INSTALL_COMMAND "" STEP_TARGETS configure build - ${cmake_3_1_BUILD_ALWAYS} - ${cmake_3_4_USES_TERMINAL_OPTIONS} + BUILD_ALWAYS 1 + USES_TERMINAL_CONFIGURE 1 + USES_TERMINAL_BUILD 1 + USES_TERMINAL_INSTALL 1 ) if(CMAKE_VERSION VERSION_LESS 3.1.0) @@ -150,7 +138,7 @@ function(llvm_ExternalProject_Add name source_dir) COMMENT "Forcing rebuild of ${name}" DEPENDEES configure clean DEPENDS ${ALWAYS_REBUILD} ${ARG_DEPENDS} ${TOOLCHAIN_BINS} - ${cmake_3_4_USES_TERMINAL} ) + USES_TERMINAL 1 ) endif() if(ARG_USE_TOOLCHAIN) @@ -164,7 +152,7 @@ function(llvm_ExternalProject_Add name source_dir) DEPENDEES configure ${force_deps} WORKING_DIRECTORY ${BINARY_DIR} - ${cmake_3_4_USES_TERMINAL} + USES_TERMINAL 1 ) ExternalProject_Add_StepTargets(${name} clean)