summaryrefslogtreecommitdiffstats
path: root/mkspecs/common/ios/versions.conf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/common/ios/versions.conf')
-rw-r--r--mkspecs/common/ios/versions.conf60
1 files changed, 20 insertions, 40 deletions
diff --git a/mkspecs/common/ios/versions.conf b/mkspecs/common/ios/versions.conf
index b755068769..319144627a 100644
--- a/mkspecs/common/ios/versions.conf
+++ b/mkspecs/common/ios/versions.conf
@@ -25,9 +25,6 @@
#
# IMPORTANT:
#
-# Xcode versions <= 4.2.x must be installed in /Developer.
-# Xcode versions >= 4.3.x must be installed in /Applications
-#
# Xcode versions >= 4.10 & < 5.0 and versions >= 10.0 are not supported due to
# the way the version checks are done here. As Apple (so far) has not used
# minor version numbers greater than 3 for Xcode, and the Xcode major version
@@ -62,59 +59,48 @@ QMAKE_IPHONEOS_DEPLOYMENT_TARGET = 4.0
###########################################################################
+# Get path of Xcode's Developer directory
+QMAKE_XCODE_DEVELOPER_PATH = $$system(xcode-select --print-path)
+
+# Make sure Xcode path is valid
+!exists($$QMAKE_XCODE_DEVELOPER_PATH): \
+ error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}! Please use xcode-select to choose Xcode installation path")
+
# No Xcode version specified?
isEmpty(QMAKE_IOS_XCODE_VERSION) {
# Get version string from installed Xcode
- exists(/Applications/Xcode.app/Contents/Developer) {
- QMAKE_IOS_XCODE_INFO = $$system(/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -version)
- } else: QMAKE_IOS_XCODE_INFO = $$system(/Developer/usr/bin/xcodebuild -version)
+ QMAKE_IOS_XCODE_INFO = $$system($${QMAKE_XCODE_DEVELOPER_PATH}/usr/bin/xcodebuild -version)
# Extract Xcode version number from output
QMAKE_IOS_XCODE_VERSION = $$member(QMAKE_IOS_XCODE_INFO, 1)
QMAKE_IOS_XCODE_INFO =
}
-# Make sure Xcode version is valid
-!lessThan(QMAKE_IOS_XCODE_VERSION, "4.3") {
- # Xcode 4.3+ is stored in /Applications
- QMAKE_IOS_PLATFORM_PATH = /Applications/Xcode.app/Contents/Developer/Platforms
-
- # Make sure Xcode path is valid
- !exists($$QMAKE_IOS_PLATFORM_PATH): error("Xcode is not installed in /Applications/Xcode.app! Edit mkspecs/common/ios/versions.conf to specify version installed.")
-} else {
- # Older Xcode versions are stored in /Developer
- QMAKE_IOS_PLATFORM_PATH = /Developer/Platforms
-
- # Make sure Xcode path is valid
- !exists($$QMAKE_IOS_PLATFORM_PATH): error("Xcode is not installed in /Developer! Edit mkspecs/common/ios/versions.conf to specify version installed.")
-}
+QMAKE_XCODE_PLATFORM_PATH = $${QMAKE_XCODE_DEVELOPER_PATH}/Platforms
# iOS 4.3 is the preferred version as it is the earliest version that is armv7/gles2 only
QMAKE_IPHONEOS_PREFERRED_TARGET = 4.3
+# Get lists of installed SDKs from Xcode
+QMAKE_XCODE_SDKS = $$system($${QMAKE_XCODE_DEVELOPER_PATH}/usr/bin/xcodebuild -showsdks)
+
# Building for iOS device?
!*simulator* {
# No iOS SDK version specified?
isEmpty(QMAKE_IOS_SDK_VERSION) {
- # Get version string from installed Xcode
- !lessThan(QMAKE_IOS_XCODE_VERSION, "4.3") {
- QMAKE_IOS_SDK_INFO = $$system(/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -showsdks)
- } else: QMAKE_IOS_SDK_INFO = $$system(/Developer/usr/bin/xcodebuild -showsdks)
-
# Get names of installed device SDKs
- QMAKE_IOS_SDK_INFO = $$find(QMAKE_IOS_SDK_INFO, ^iphoneos)
- for(v, QMAKE_IOS_SDK_INFO): {
+ iphoneos_sdks = $$find(QMAKE_XCODE_SDKS, ^iphoneos)
+ for(v, iphoneos_sdks): {
# Extract SDK version number from output
v = $$replace(v,iphoneos,)
# Use latest SDK version
greaterThan(v, $$QMAKE_IOS_SDK_VERSION): QMAKE_IOS_SDK_VERSION = $$v
}
- QMAKE_IOS_SDK_INFO =
}
# Make sure iOS SDK version is valid
- !exists($$QMAKE_IOS_PLATFORM_PATH/iPhoneOS.platform/Developer/SDKs/iPhoneOS$${QMAKE_IOS_SDK_VERSION}.sdk) {
+ !exists($$QMAKE_XCODE_PLATFORM_PATH/iPhoneOS.platform/Developer/SDKs/iPhoneOS$${QMAKE_IOS_SDK_VERSION}.sdk) {
error("iOS $$QMAKE_IOS_SDK_VERSION SDK not found! Edit mkspecs/common/ios/versions.conf to specify version installed.")
}
@@ -134,25 +120,19 @@ QMAKE_IPHONEOS_PREFERRED_TARGET = 4.3
} else {
# No iOS simulator SDK version specified?
isEmpty(QMAKE_IOS_SIMULATOR_SDK_VERSION) {
- # Get version string from installed Xcode
- !lessThan(QMAKE_IOS_XCODE_VERSION, "4.3") {
- QMAKE_IOS_SDK_INFO = $$system(/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -showsdks)
- } else: QMAKE_IOS_SDK_INFO = $$system(/Developer/usr/bin/xcodebuild -showsdks)
-
# Get names of installed device SDKs
- QMAKE_IOS_SDK_INFO = $$find(QMAKE_IOS_SDK_INFO, ^iphonesimulator)
- for(v, QMAKE_IOS_SDK_INFO): {
+ iphone_simulator_sdks = $$find(QMAKE_XCODE_SDKS, ^iphonesimulator)
+ for(v, iphone_simulator_sdks): {
# Extract SDK version number from output
v = $$replace(v,iphonesimulator,)
# Use latest SDK version
greaterThan(v, $$QMAKE_IOS_SIMULATOR_SDK_VERSION): QMAKE_IOS_SIMULATOR_SDK_VERSION = $$v
}
- QMAKE_IOS_SDK_INFO =
}
# Make sure iOS simulator SDK version is valid
- !exists($$QMAKE_IOS_PLATFORM_PATH/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$${QMAKE_IOS_SIMULATOR_SDK_VERSION}.sdk) {
+ !exists($$QMAKE_XCODE_PLATFORM_PATH/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$${QMAKE_IOS_SIMULATOR_SDK_VERSION}.sdk) {
error("iOS $$QMAKE_IOS_SIMULATOR_SDK_VERSION simulator SDK not found! Edit mkspecs/common/ios/versions.conf to specify version installed.")
}
@@ -170,8 +150,8 @@ QMAKE_IPHONEOS_PREFERRED_TARGET = 4.3
}
}
-QMAKE_IPHONEOS_PREFERRED_TARGET =
-QMAKE_IOS_PLATFORM_PATH =
+unset(QMAKE_IPHONEOS_PREFERRED_TARGET)
+unset(QMAKE_XCODE_PLATFORM_PATH)
# Set deployment target
QMAKE_IOS_VERSION_FLAGS = -miphoneos-version-min=$$QMAKE_IPHONEOS_DEPLOYMENT_TARGET