Simplify how we resolve the SDK root on Mac OS

We now take advantage of the fact that xcodebuild -version allows you to
pass the key that you're interested in, to only print that single value.
This technique is used by Apple's own build scripts as well.

Change-Id: I57b8424590d4137a0e7f263a318e17ee2e0dfad4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-03-12 14:50:37 +01:00 committed by The Qt Project
parent c9eb0f9b49
commit e11c2165c5

View File

@ -5,13 +5,8 @@ isEmpty(QMAKE_MAC_SDK): \
contains(QMAKE_MAC_SDK, .*/.*): \
error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
QMAKE_MAC_SDK_INFO = $$system("xcodebuild -sdk $$QMAKE_MAC_SDK -version 2>/dev/null", lines)
isEmpty(QMAKE_MAC_SDK_INFO): error("Could not resolve SDK \'$$QMAKE_MAC_SDK\'")
defineReplace(qtMacSDKInfo): \
return($$replace($$list($$find(QMAKE_MAC_SDK_INFO, ^$$1:)), ^$$1:(.*), \\1))
QMAKE_MAC_SDK_PATH = $$qtMacSDKInfo(Path)
QMAKE_MAC_SDK_PATH = $$system("xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
!equals(MAKEFILE_GENERATOR, XCODE) {
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH