From 52642b466ec47f61195b4112407845e62b381596 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Fri, 20 Mar 2015 23:48:22 +0100 Subject: [PATCH 1/2] OS X: Look for Xcode 5 platform-specific Frameworks The Xcode 5 platform specific framework locations differ from the Xcode 6 ones. Look first for the Xcode 6 ones, then for iOS Xcode 5 ones and last for the Xcode 5 OS X ones. For reference, the XCTest.framework is located as follows: Xcode511.app/Contents/Developer/Library/Frameworks/XCTest.framework Xcode511.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/Developer/Library/Frameworks/XCTest.framework Xcode511.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Developer/Library/Frameworks/XCTest.framework Xcode601.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework Xcode601.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework Xcode601.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework Signed-off-by: Gregor Jasny --- Modules/Platform/Darwin.cmake | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index b912d98d3..4e4810a2a 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -167,12 +167,20 @@ if(_CMAKE_OSX_SYSROOT_PATH) ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/Frameworks ) # add platform developer framework path if exists - get_filename_component(_CMAKE_OSX_PLATFORM_FRAMEWORK_PATH - ${_CMAKE_OSX_SYSROOT_PATH}/../../Library/Frameworks ABSOLUTE) - if(IS_DIRECTORY ${_CMAKE_OSX_PLATFORM_FRAMEWORK_PATH}) - list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH - ${_CMAKE_OSX_PLATFORM_FRAMEWORK_PATH}) - endif() + foreach(_path + # Xcode 6 + ${_CMAKE_OSX_SYSROOT_PATH}/../../Library/Frameworks + # Xcode 5 iOS + ${_CMAKE_OSX_SYSROOT_PATH}/Developer/Library/Frameworks + # Xcode 5 OSX + ${_CMAKE_OSX_SYSROOT_PATH}/../../../../../Library/Frameworks + ) + get_filename_component(_abolute_path "${_path}" ABSOLUTE) + if(EXISTS "${_abolute_path}") + list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH "${_abolute_path}") + break() + endif() + endforeach() endif() list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH /Library/Frameworks From 6ab1413499284dc8e1d7a8ac1f1940798a79e674 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Mon, 23 Mar 2015 18:06:46 +0100 Subject: [PATCH 2/2] Tests: Enable XCTest tests for Xcode 5 Signed-off-by: Gregor Jasny --- Tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 49fd02b67..41032f8f6 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1519,7 +1519,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) endif() - if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6 + if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5 AND OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)") set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1}) ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $ -V)