2015-06-15 15:56:23 +00:00
|
|
|
|
|
|
|
# For Qt applications we want Xcode project files as the generated output,
|
|
|
|
# but since qmake doesn't handle the transition between makefiles and Xcode
|
|
|
|
# project files (which happens when using subdirs), we can't just override
|
|
|
|
# MAKEFILE_GENERATOR. Instead, we generate the Xcode project by spawing a
|
|
|
|
# child qmake process with -spec macx-xcode and let the top level qmake
|
|
|
|
# process generate a wrapper makefile that forwards everything to xcodebuild.
|
|
|
|
|
|
|
|
TEMPLATE = aux
|
|
|
|
|
|
|
|
SOURCES =
|
|
|
|
OBJECTIVE_SOURCES =
|
|
|
|
RESOURCES =
|
|
|
|
INSTALLS =
|
|
|
|
QMAKE_EXTRA_COMPILERS =
|
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
!mkpath($$OUT_PWD): \
|
|
|
|
error("Failed to create $$OUT_PWD")
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
args =
|
2016-10-04 05:21:24 +00:00
|
|
|
prev_arg =
|
|
|
|
for(arg, QMAKE_ARGS) {
|
|
|
|
!equals(arg, "-spec"):!equals(prev_arg, "-spec"): \
|
|
|
|
args += $$system_quote($$arg)
|
|
|
|
prev_arg = $$arg
|
|
|
|
}
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2016-09-30 09:01:13 +00:00
|
|
|
cmd = "$$QMAKE_QMAKE $$system_quote($$_PRO_FILE_) -spec macx-xcode $$args"
|
2015-06-16 15:14:53 +00:00
|
|
|
debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'")
|
2016-11-11 09:02:34 +00:00
|
|
|
system("$$QMAKE_CD $$system_quote($$OUT_PWD) && $$cmd")
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
# Subtargets
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
for(build, BUILDS): \
|
|
|
|
SUBTARGETS += $$eval($${build}.target)
|
|
|
|
QMAKE_EXTRA_VARIABLES += SUBTARGETS
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
CONFIG += no_default_goal_deps
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2016-03-07 20:11:11 +00:00
|
|
|
DEVICE_SDK = $${device.sdk}
|
|
|
|
SIMULATOR_SDK = $${simulator.sdk}
|
2016-02-16 14:29:59 +00:00
|
|
|
ios {
|
2017-11-14 07:55:44 +00:00
|
|
|
DEVICE_FILTER = --platform iOS --minimum-deployment-target $$QMAKE_IOS_DEPLOYMENT_TARGET
|
2016-02-16 14:29:59 +00:00
|
|
|
GENERIC_DEVICE_DESTINATION = "generic/platform=iOS"
|
|
|
|
}
|
|
|
|
tvos {
|
2017-11-14 07:55:44 +00:00
|
|
|
DEVICE_FILTER = --platform tvOS --minimum-deployment-target $$QMAKE_TVOS_DEPLOYMENT_TARGET
|
2016-02-16 14:29:59 +00:00
|
|
|
GENERIC_DEVICE_DESTINATION = "generic/platform=tvOS"
|
|
|
|
}
|
2016-05-20 06:01:59 +00:00
|
|
|
watchos {
|
2017-11-14 07:55:44 +00:00
|
|
|
DEVICE_FILTER = --platform watchOS --minimum-deployment-target $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
|
2016-05-20 06:01:59 +00:00
|
|
|
GENERIC_DEVICE_DESTINATION = "generic/platform=watchOS"
|
|
|
|
}
|
2016-03-07 20:11:11 +00:00
|
|
|
QMAKE_EXTRA_VARIABLES += DEVICE_SDK SIMULATOR_SDK DEVICE_FILTER GENERIC_DEVICE_DESTINATION
|
|
|
|
|
|
|
|
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/xcodebuild.mk)
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
# Distclean
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
distfiles = $${TARGET}.xcodeproj
|
|
|
|
for(build, BUILDS): \
|
|
|
|
distfiles += $$title($$eval($${build}.target))
|
|
|
|
distclean_xcodebuild.commands = -$(DEL_FILE) -R $$distfiles
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
distclean.depends += clean_all distclean_xcodebuild
|
2015-06-15 15:56:23 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += distclean distclean_xcodebuild
|
2015-06-16 15:14:53 +00:00
|
|
|
|
|
|
|
# Empty exclusive builds, we've set them up manually
|
|
|
|
BUILDS =
|