From d24287f62762cb56e5d52986dc6e06f2c50743fa Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 25 Feb 2015 13:48:28 -0800 Subject: [PATCH] look in Xcode application for 10.9 SDK --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7a64fef18..288d669077 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,11 +96,16 @@ if (APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8) # find the 10.9 SDK path - execute_process(COMMAND xcodebuild -sdk -version OUTPUT_VARIABLE XCODE_SDK_VERSIONS) - string(REGEX MATCH \\/.+MacOSX10.9.sdk OSX_SDK_PATH ${XCODE_SDK_VERSIONS}) + find_path(_OSX_DESIRED_SDK_PATH NAME MacOSX10.9.sdk HINTS /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ ${OSX_SDK_PATH}) + + if (NOT _OSX_DESIRED_SDK_PATH) + message(FATAL_ERROR "Could not find OS X 10.9 SDK. Please pass OSX_SDK_PATH to CMake to point us to your SDKs directory.") + else () + message(STATUS "Found OS X 10.9 SDK at ${_OSX_DESIRED_SDK_PATH}/MacOSX10.9.sdk") + endif () # set that as the SDK to use - set(CMAKE_OSX_SYSROOT ${OSX_SDK_PATH}) + set(CMAKE_OSX_SYSROOT ${_OSX_DESIRED_SDK_PATH}/MacOSX10.9.sdk) endif () # Find includes in corresponding build directories