diff options
Diffstat (limited to 'deps/CMakeLists.txt')
-rw-r--r-- | deps/CMakeLists.txt | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 386320d81..1e025adac 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -51,11 +51,22 @@ if (MSVC) message(FATAL_ERROR "Unable to detect architecture") endif () elseif (APPLE) - set(DEPS_OSX_TARGET "10.9" CACHE STRING "OS X SDK version to build against") - set(DEPS_OSX_SYSROOT - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${DEPS_OSX_TARGET}.sdk" - CACHE PATH "OS X SDK directory" - ) + message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}") + if (CMAKE_OSX_DEPLOYMENT_TARGET) + set(DEP_OSX_TARGET "${CMAKE_OSX_DEPLOYMENT_TARGET}") + message("OS X Deployment Target: ${DEP_OSX_TARGET}") + else () + # Attempt to infer the SDK version from the CMAKE_OSX_SYSROOT, + # this is done because wxWidgets need the min version explicitly set + string(REGEX MATCH "[0-9]+[.][0-9]+[.]sdk$" DEP_OSX_TARGET "${CMAKE_OSX_SYSROOT}") + string(REGEX MATCH "^[0-9]+[.][0-9]+" DEP_OSX_TARGET "${DEP_OSX_TARGET}") + + if (NOT DEP_OSX_TARGET) + message(FATAL_ERROR "Could not determine OS X SDK version. Please use -DCMAKE_OSX_DEPLOYMENT_TARGET=<version>") + endif () + + message("OS X Deployment Target (inferred from default): ${DEP_OSX_TARGET}") + endif () include("deps-macos.cmake") else () |