summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-01-07 13:49:52 +0100
committerRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-01-16 11:24:09 +0100
commit5884160db62f32bed91f8449c4ca1204b8ba5dbd (patch)
tree76dcbf4cd20edeeb3adb1e77f27c4181126868a6 /mkspecs
parent576cf413bb126e0350a2d8d79267496d7619e6c2 (diff)
iOS: add AppIcon asset name to Xcode project
The current work-flow for adding app icons to an iOS app during deployment is not good. You basically need to specify that you want to use asset catalogs from within Xcode and add your icons there. The problem is that qmake will regenerate the Xcode project the next time it runs, and your changes will then be lost. This patch will check if the project has a valid asset catalog assigned to QMAKE_BUNDLE_DATA, and configure the Xcode project to use it for app icons. Change-Id: I06621ca46aad91de96cb23ba8ca3b1a3f1226670 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf15
1 files changed, 15 insertions, 0 deletions
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
index aa849eb8b1..f1f23dd716 100644
--- a/mkspecs/macx-ios-clang/features/default_post.prf
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -174,6 +174,21 @@ macx-xcode {
ios_device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
QMAKE_MAC_XCODE_SETTINGS += ios_device_family
+ # 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()
+ }
+
# Set up default 4-inch iPhone/iPod launch image so that our apps
# support the full screen resolution of those devices.
launch_image = Default-568h@2x.png