From 765b46d1e1c6bc397942764fcbdd9fab9d29cb11 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Oct 2013 10:44:25 -0400 Subject: [PATCH] Xcode: Fix test architecture selection for Xcode >= 5 In Tests/Architecture and Tests/BuildDepends/Project we select a set of OS X cpu architectures to use for the test. Prior to Xcode 4 we always used i386 and ppc. Starting with Xcode 4, the tools do not support ppc but do support x86_64, so we switch to that. Fix the version check to recognize Xcode >= 5 as at least Xcode 4 and use the new architectures. --- Tests/Architecture/CMakeLists.txt | 4 ++-- Tests/BuildDepends/Project/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/Architecture/CMakeLists.txt b/Tests/Architecture/CMakeLists.txt index 927ce3fed..ea5fc0b50 100644 --- a/Tests/Architecture/CMakeLists.txt +++ b/Tests/Architecture/CMakeLists.txt @@ -7,8 +7,8 @@ function(test_for_xcode4 result_var) execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE ov RESULT_VARIABLE rv ) - if("${rv}" STREQUAL "0") - if(ov MATCHES "^Xcode 4.[0-9].*$") + if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.") + if(NOT CMAKE_MATCH_1 VERSION_LESS 4) set(${result_var} 1 PARENT_SCOPE) endif() endif() diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index b4c6a0710..8806ecdf1 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -7,8 +7,8 @@ function(test_for_xcode4 result_var) execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE ov RESULT_VARIABLE rv ) - if("${rv}" STREQUAL "0") - if(ov MATCHES "^Xcode 4.[0-9].*$") + if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.") + if(NOT CMAKE_MATCH_1 VERSION_LESS 4) set(${result_var} 1 PARENT_SCOPE) endif() endif()