summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/mac/default_pre.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/mac/default_pre.prf')
-rw-r--r--mkspecs/features/mac/default_pre.prf25
1 files changed, 15 insertions, 10 deletions
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index e21e749ee9..44636f2288 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -10,18 +10,23 @@ isEmpty(QMAKE_XCODE_DEVELOPER_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 xcodebuild 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)
+isEmpty(QMAKE_XCODEBUILD_PATH): \
+ QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
+
+!isEmpty(QMAKE_XCODEBUILD_PATH) {
+ # Make sure Xcode is set up properly
+ !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
+ error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
+
+ isEmpty(QMAKE_XCODE_VERSION) {
+ # Extract Xcode version using xcodebuild
+ xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
+ QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
+ isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
+ unset(xcode_version)
+ }
}
isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {