llvm.org GIT mirror llvm / 22f7a63
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272327 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 4 years ago
1 changed file(s) with 7 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
6060 list(APPEND TOOLCHAIN_BINS ${RUNTIME_LIBRARIES})
6161 endif()
6262
63 if(CMAKE_VERSION VERSION_GREATER 3.1.0)
64 set(cmake_3_1_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL 1)
65 set(cmake_3_1_BUILD_ALWAYS BUILD_ALWAYS 1)
66 endif()
67
68 if(CMAKE_VERSION VERSION_GREATER 3.3.20150708)
69 set(cmake_3_4_USES_TERMINAL_OPTIONS
70 USES_TERMINAL_CONFIGURE 1
71 USES_TERMINAL_BUILD 1
72 USES_TERMINAL_INSTALL 1
73 )
74 set(cmake_3_4_USES_TERMINAL USES_TERMINAL 1)
75 endif()
76
7763 set(STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/${name}-stamps/)
7864 set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${name}-bins/)
7965
116102 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}-clobber-stamp)
117103
118104 if(ARG_EXCLUDE_FROM_ALL)
119 set(exclude ${cmake_3_1_EXCLUDE_FROM_ALL})
105 set(exclude EXCLUDE_FROM_ALL 1)
120106 endif()
121107
122108 ExternalProject_Add(${name}
134120 ${PASSTHROUGH_VARIABLES}
135121 INSTALL_COMMAND ""
136122 STEP_TARGETS configure build
137 ${cmake_3_1_BUILD_ALWAYS}
138 ${cmake_3_4_USES_TERMINAL_OPTIONS}
123 BUILD_ALWAYS 1
124 USES_TERMINAL_CONFIGURE 1
125 USES_TERMINAL_BUILD 1
126 USES_TERMINAL_INSTALL 1
139127 )
140128
141129 if(CMAKE_VERSION VERSION_LESS 3.1.0)
149137 COMMENT "Forcing rebuild of ${name}"
150138 DEPENDEES configure clean
151139 DEPENDS ${ALWAYS_REBUILD} ${ARG_DEPENDS} ${TOOLCHAIN_BINS}
152 ${cmake_3_4_USES_TERMINAL} )
140 USES_TERMINAL 1 )
153141 endif()
154142
155143 if(ARG_USE_TOOLCHAIN)
163151 DEPENDEES configure
164152 ${force_deps}
165153 WORKING_DIRECTORY ${BINARY_DIR}
166 ${cmake_3_4_USES_TERMINAL}
154 USES_TERMINAL 1
167155 )
168156 ExternalProject_Add_StepTargets(${name} clean)
169157