Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Deployment Info and icons using CMake

Tags:

xcode

ios

cmake

I've tried looking for info on how to set these (in red) using CMake but have had no luck so far:

enter image description here

1st red box issue:

First of all, even though the device seems like it's been set to 'Universal' correctly, the value isn't being interpreted correctly by Xcode. When I set it to 'Universal' manually using the dropdown, it gives a tab each for iPhone and iPad. Furthermore, I know it's not being interpreted correctly as the app does not function correctly (in my case, neither the launch image nor the app itself run full screen).

I don't think setting orientation programmatically is an option for me since I need the launch image in the correct orientation as well. So can't do something like this: How do I programmatically set device orientation in iOS7?

2nd red box issue:

I use an asset file for all my icons, so at the moment I'm having to build using CMake and then press 'Use Asset Catalog' each time. I found this but doesn't seem very useful: http://cmake.3232098.n2.nabble.com/Icon-and-Launch-image-support-for-iOS-apps-td7590970.html

like image 714
Ash Avatar asked Sep 10 '15 04:09

Ash


2 Answers

Regarding the "1st box issue", I've found that the approach taken by this demo project works really well.

https://github.com/forexample/testapp/blob/master/CMakeLists.txt

They use a templated Info.plist to inject the bundle identifier, etc, during configure. The nice part is then you can modify the orientations in the plist.in file, and then these get translated cleanly to the Info.plist once you open the project.

like image 137
yano Avatar answered Oct 20 '22 01:10

yano


Regarding the 2nd red box issue, i found that the attribute I needed to set was XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME

For example:

set_target_properties(${TARGET} PROPERTIES
    XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")

For Launch Images I got it to work by setting it in the plist.in file under UILaunchStoryboardName as described in yano's previous answer.

like image 27
Brad Kittenbrink Avatar answered Oct 20 '22 00:10

Brad Kittenbrink