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 =
|
|
|
|
for(arg, QMAKE_ARGS): \
|
|
|
|
args += $$system_quote($$arg)
|
2015-06-15 15:56:23 +00:00
|
|
|
|
2015-06-16 15:14:53 +00:00
|
|
|
cmd = "$$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode"
|
|
|
|
debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'")
|
|
|
|
system("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 {
|
|
|
|
DEVICE_FILTER = "iPhone|iPad"
|
|
|
|
GENERIC_DEVICE_DESTINATION = "generic/platform=iOS"
|
|
|
|
}
|
|
|
|
tvos {
|
|
|
|
DEVICE_FILTER = "Apple TV"
|
|
|
|
GENERIC_DEVICE_DESTINATION = "generic/platform=tvOS"
|
|
|
|
}
|
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 =
|