Allow the OS X SDK version to be specified separately from the deployment target.

CMAKE_OSX_DEPLOYMENT_TARGET sets the minimum version that we want the app to run on,
CMAKE_OSX_SDK is the name of the SDK which we want to build against.

The OS X 10.5 SDK does not exist when building on OS X 10.7,
so allow this to be set to 10.6 instead.
This commit is contained in:
Robert Knight 2012-05-04 09:49:13 +01:00
parent 666c36a4bd
commit 932cddfb77

View file

@ -36,13 +36,14 @@ if (APPLE)
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
# Build the updater so that it works on OS X 10.5 and above.
# If you are building with XCode 4 or newer, you will need to up
# this target - depending on the versions of the Mac OS X SDK that
# are available to build with in /Developer/SDKs/
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
# Set the SDK which the updater is built against.
# The available SDK versions are those which exist in /Developer/SDKs/
set(CMAKE_OSX_SDK 10.6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}.sdk")
set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${CMAKE_OSX_SDK}.sdk")
endif()
add_subdirectory(src)