qt5base-lts/mkspecs/features/mac/default_pre.prf
Tor Arne Vestbø 5c92a8b70a Xcode: Dynamically choose release/debug libs based on current configuration
Non-framework builds would automatically link to whatever Qt library
matched the config at the time of running qmake, eg hard-coded to
libQtCore_debug, while Xcode itself allowed the user to switch between
release and debug configurations.

We now append an Xcode settings variable to the library path, which gets
resolved at build time depending on the current config in Xcode.

Change-Id: I12873e38a28d9595ef3fd0ae0ad849e6744833a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-10-16 19:33:15 +02:00

32 lines
1.4 KiB
Plaintext

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)
}
# These two variables are used by the xcode_dynamic_library_suffix
# feature, which allows Xcode to choose the Qt libraries to link to
# at build time, depending on the current Xcode SDK and configuration.
QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX