2012-11-23 12:26:50 +00:00
|
|
|
|
2015-06-15 15:56:23 +00:00
|
|
|
equals(TEMPLATE, app):contains(CONFIG, qt) {
|
2013-09-26 15:00:19 +00:00
|
|
|
# If the application uses Qt, it needs to be an application bundle
|
|
|
|
# to be able to deploy and run on iOS. The only exception to this
|
|
|
|
# is if you're working with a jailbroken device and can run the
|
|
|
|
# resulting binary from the console/over SSH, but that's not a
|
|
|
|
# use-case we care about, so no need to complicate the logic.
|
2015-06-15 15:56:23 +00:00
|
|
|
CONFIG *= app_bundle
|
|
|
|
|
|
|
|
# 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 spawning a
|
|
|
|
# child qmake process with -spec macx-xcode and let the top level qmake
|
|
|
|
# process generate a wrapper makefile that forwards everything to xcodebuild.
|
|
|
|
equals(MAKEFILE_GENERATOR, UNIX): \
|
|
|
|
CONFIG = xcodebuild $$CONFIG
|
2012-11-23 12:26:50 +00:00
|
|
|
}
|
|
|
|
|
2015-06-15 15:56:23 +00:00
|
|
|
load(default_post)
|
|
|
|
|
2013-06-27 10:02:05 +00:00
|
|
|
macx-xcode {
|
2012-12-06 14:29:05 +00:00
|
|
|
ios_device_family.name = TARGETED_DEVICE_FAMILY
|
|
|
|
ios_device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
|
|
|
|
QMAKE_MAC_XCODE_SETTINGS += ios_device_family
|
2013-11-26 12:40:21 +00:00
|
|
|
|
2015-01-07 12:49:52 +00:00
|
|
|
# If QMAKE_BUNDLE_DATA contains an asset catalog that includes an
|
|
|
|
# AppIcon.appiconset, we configure Xcode to use it for app icons.
|
|
|
|
for(bundle_data, QMAKE_BUNDLE_DATA) {
|
|
|
|
for(bundle_file, $${bundle_data}.files) {
|
|
|
|
!contains(bundle_file, .*\.xcassets$): next()
|
|
|
|
!exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next()
|
|
|
|
|
|
|
|
asset_catalog_appicon.name = "ASSETCATALOG_COMPILER_APPICON_NAME"
|
|
|
|
asset_catalog_appicon.value = "AppIcon"
|
|
|
|
QMAKE_MAC_XCODE_SETTINGS += asset_catalog_appicon
|
|
|
|
break()
|
|
|
|
}
|
|
|
|
!isEmpty(asset_catalog_appicon.name): break()
|
|
|
|
}
|
|
|
|
|
2013-11-26 12:40:21 +00:00
|
|
|
# Set up default 4-inch iPhone/iPod launch image so that our apps
|
|
|
|
# support the full screen resolution of those devices.
|
2015-07-27 13:27:07 +00:00
|
|
|
qmake_launch_image = Default-568h@2x.png
|
|
|
|
qmake_copy_image.input = $$QMAKESPEC/$$qmake_launch_image
|
|
|
|
qmake_copy_image.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$qmake_launch_image
|
|
|
|
qmake_copy_image.CONFIG = verbatim
|
|
|
|
QMAKE_SUBSTITUTES += qmake_copy_image
|
|
|
|
qmake_launch_images.files = $$qmake_copy_image.output
|
|
|
|
QMAKE_BUNDLE_DATA += qmake_launch_images
|
2014-11-03 10:23:05 +00:00
|
|
|
|
2014-11-27 11:58:42 +00:00
|
|
|
lessThan(QMAKE_XCODE_VERSION, "6.0") {
|
|
|
|
warning("You need to update Xcode to version 6 or newer to fully support iPhone6/6+")
|
|
|
|
} else {
|
|
|
|
# Set up default LaunchScreen to support iPhone6/6+
|
2015-07-27 13:27:07 +00:00
|
|
|
qmake_launch_screen = LaunchScreen.xib
|
|
|
|
qmake_copy_launch_screen.input = $$QMAKESPEC/$$qmake_launch_screen
|
|
|
|
qmake_copy_launch_screen.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$qmake_launch_screen
|
|
|
|
QMAKE_SUBSTITUTES += qmake_copy_launch_screen
|
|
|
|
qmake_launch_screens.files = $$qmake_copy_launch_screen.output
|
|
|
|
QMAKE_BUNDLE_DATA += qmake_launch_screens
|
2014-11-27 11:58:42 +00:00
|
|
|
}
|
2012-12-06 14:29:05 +00:00
|
|
|
}
|
|
|
|
|
2013-06-27 10:02:05 +00:00
|
|
|
macx-xcode {
|
2013-10-25 12:42:48 +00:00
|
|
|
arch_iphoneos.name = "ARCHS[sdk=iphoneos*]"
|
|
|
|
arch_iphoneos.value = $$QMAKE_IOS_DEVICE_ARCHS
|
|
|
|
arch_iphonesimulator.name = "ARCHS[sdk=iphonesimulator*]"
|
|
|
|
arch_iphonesimulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS
|
|
|
|
|
|
|
|
QMAKE_MAC_XCODE_SETTINGS += arch_iphoneos arch_iphonesimulator
|
2014-11-06 15:14:32 +00:00
|
|
|
QMAKE_XCODE_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS
|
2014-11-17 14:00:45 +00:00
|
|
|
|
|
|
|
only_active_arch.name = ONLY_ACTIVE_ARCH
|
|
|
|
only_active_arch.value = YES
|
|
|
|
only_active_arch.build = debug
|
|
|
|
QMAKE_MAC_XCODE_SETTINGS += only_active_arch
|
2013-04-11 12:40:58 +00:00
|
|
|
} else {
|
2014-10-24 15:43:18 +00:00
|
|
|
# Be more specific about which architecture we're targeting
|
|
|
|
contains(QT_ARCH, arm.*): \
|
2014-11-04 18:41:48 +00:00
|
|
|
VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS
|
2013-10-25 12:42:48 +00:00
|
|
|
else: \
|
2014-11-04 18:41:48 +00:00
|
|
|
VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS
|
2013-10-25 12:42:48 +00:00
|
|
|
|
2014-10-28 12:27:25 +00:00
|
|
|
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
|
|
|
|
|
2014-11-04 18:41:48 +00:00
|
|
|
ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
|
|
|
|
ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
|
|
|
|
|
|
|
|
QMAKE_EXTRA_VARIABLES += VALID_ARCHS ACTIVE_ARCHS ARCH_ARGS
|
|
|
|
|
|
|
|
arch_flags = $(EXPORT_ARCH_ARGS)
|
2013-04-11 12:40:58 +00:00
|
|
|
|
|
|
|
QMAKE_CFLAGS += $$arch_flags
|
|
|
|
QMAKE_CXXFLAGS += $$arch_flags
|
|
|
|
QMAKE_LFLAGS += $$arch_flags
|
2013-03-11 13:54:06 +00:00
|
|
|
}
|