From 4f002f325614ef2c5f893c6fffffd76ec4796bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 8 Apr 2013 16:34:33 +0200 Subject: Use absolute paths for Xcode helpers such as xcodebuild/xcrun/xcode-select We always use the xcodebuild/xcrun/xcode-select binaries in /usr/bin, as these will dispatch to the right binary based on what Xcode version has been chosen using xcode-select -switch. This fixes an issue where a tool was in the path from another Xcode installation. We can rely on the tools as they are present on a clean Mac OS install. Change-Id: I1d3cc1e92604f9be6d6f14639cb6322234edd696 Reviewed-by: Oswald Buddenhagen --- mkspecs/common/xcode.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkspecs/common/xcode.conf') diff --git a/mkspecs/common/xcode.conf b/mkspecs/common/xcode.conf index 9da6406f7f..0095469421 100644 --- a/mkspecs/common/xcode.conf +++ b/mkspecs/common/xcode.conf @@ -3,7 +3,7 @@ # # Get path of Xcode's Developer directory -QMAKE_XCODE_DEVELOPER_PATH = $$system("xcode-select --print-path") +QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path") isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \ error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.") @@ -12,6 +12,6 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \ error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.") # Extract Xcode version using xcodebuild -xcode_version = $$system("xcodebuild -version") +xcode_version = $$system("/usr/bin/xcodebuild -version") QMAKE_XCODE_VERSION = $$member(xcode_version, 1) unset(xcode_version) -- cgit v1.2.3 From f73a7ca46cb15d77608a4995921b4d501c21bdee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 8 Apr 2013 16:41:27 +0200 Subject: Verify Xcode installation more thoroughly before relying on it We depend on Xcode for building Qt itself and user application on Mac OS. The user may have an Xcode install that is not set up properly, in which case we would fail compilation in mysterious ways. Instead we try to detect misconfigured or missing Xcode installs as early as possible. We try to detect if an Xcode install has not been chosen yet, and if the user has not accepted the Xcode license agreement. We need to do these checks both in configure, as early as possible, and in mkspecs on Mac OS, as we need to error out if the user tries to build an app with the Qt SDK, but with a broken Xcode install. Change-Id: I4e3a11077a61dc5d4ee2c686d01044a9bb2c1c79 Reviewed-by: Oswald Buddenhagen --- mkspecs/common/xcode.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mkspecs/common/xcode.conf') diff --git a/mkspecs/common/xcode.conf b/mkspecs/common/xcode.conf index 0095469421..b15266b678 100644 --- a/mkspecs/common/xcode.conf +++ b/mkspecs/common/xcode.conf @@ -3,7 +3,7 @@ # # Get path of Xcode's Developer directory -QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path") +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.") @@ -11,6 +11,10 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \ !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.") + # Extract Xcode version using xcodebuild xcode_version = $$system("/usr/bin/xcodebuild -version") QMAKE_XCODE_VERSION = $$member(xcode_version, 1) -- cgit v1.2.3