[CMake] Minor fix to regex in r279152

The third version component is optional in Xcode's version spew, so we need to make it optional in the regex.

llvm-svn: 279153
This commit is contained in:
Chris Bieneman 2016-08-18 21:36:36 +00:00
parent 11eed999c4
commit a7c87a9430
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ if(NOT XCODE_VERSION)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_FILE /dev/null
)
string(REGEX MATCH "Xcode ([0-9][.][0-9][.][0-9])" version_match ${xcodebuild_version})
string(REGEX MATCH "Xcode ([0-9]([.][0-9])+)" version_match ${xcodebuild_version})
if(version_match)
message(STATUS "Identified Xcode Version: ${CMAKE_MATCH_1}")
set(XCODE_VERSION ${CMAKE_MATCH_1})