summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/mac/default_pre.prf
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-05-08 12:21:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-08 14:07:41 +0200
commit1308aa25fbf45995eac075688165e42d9e1c90f5 (patch)
tree305f432e77adc393f1bf8b2e42ccea96ddfd4606 /mkspecs/features/mac/default_pre.prf
parent032befa819cfb335876a08ca7aa5acab6d7a2f17 (diff)
Cache Xcode and SDK settings in .qmake.cache if it exists
The Xcode and SDK settings are expensive to resolve, as we're using system() calls to resolve them. We now try to detect the presence of a .qmake.cache file (and inform the user that creating one would be a good idea), and use the file to cache the various settings after resolving them. The Xcode logic had to be moved form xcode.conf as part of the mkspec, into default_pre/post.prf, so that we could cache() the resolved values. Task-number: QTBUG-30586 Change-Id: Ib5368cfee6f7e4a4a33f6be70d0e20d96896fe56 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'mkspecs/features/mac/default_pre.prf')
-rw-r--r--mkspecs/features/mac/default_pre.prf22
1 files changed, 22 insertions, 0 deletions
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index 81e1d061f8..e535c4d9e9 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -1,3 +1,25 @@
CONFIG = sdk rez $$CONFIG
load(default_pre)
+isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
+ # Get path of Xcode's Developer directory
+ QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
+ isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
+ error("Xcode path is not set. Please use xcode-select to choose Xcode installation 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.")
+
+ # Make sure Xcode is set up properly
+ isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
+ error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
+}
+
+isEmpty(QMAKE_XCODE_VERSION) {
+ # Extract Xcode version using xcodebuild
+ xcode_version = $$system("/usr/bin/xcodebuild -version")
+ QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
+ isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
+ unset(xcode_version)
+}