[CMake] Icon and Launch image support for iOS apps

Ruslan Baratov ruslan_baratov at yahoo.com
Wed Jul 8 21:55:32 EDT 2015


On 03-Jul-15 13:00, Daniel Dewald wrote:
>
> Howdy folks,
>
> I’m currently in the process of converting our internal projects from 
> premake to cmake. The process is almost complete. However I’ve been 
> stuck on a seemingly simple problem the last few days that I could 
> need some help /advise on. Since premake as well as CMake don’t have 
> an option to integrate Icon and LaunchImage support for iOS builds in 
> XCode, we have a bash script, that patches the generated project 
> files, to insert the appropriate lines to enable the icon support 
> (this basically is 1.) copying the images into the app folder 2.) 
> including the prepared xcasset file into the resource “folder” of the 
> *project* (not the target) and 3.) creating a “Copy Bundle Resources” 
> build phase step with the .xcassets file in the target’s build phases 
> tab). The script is currently run after cmake is done (in our projects 
> batch file) and this works fine so far for premake as well as cmake. 
> The problem now is that if something is changed, cmake will regenerate 
> the project files and erase those changes. The logical idea would be 
> to execute the script whenever cmake is run. However there is no such 
> functionality in cmake as far as anyone could tell me. Anybody has any 
> clue as to whether cmake supports anything in that area. All ow this 
> has to be done *BEFORE* the build process is started and *AFTER* the 
> project files have been created. Otherwise it won’t work. We really 
> need this because some genius from Apple decided it would be a good 
> idea for the apps to decide what resolution an app should use on 
> whatever lauch image resolution was choosen O_o.
>
I have no idea about .xcassets but you can use default icon names and 
just add them to the RESOURCE property of the target. Launch images can 
be set in template plist.in file (which became Info.plist of your 
application).

This might be helpful:
* https://github.com/forexample/testapp
* https://github.com/ruslo/weather

Ruslo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150709/9e303a3f/attachment.html>


More information about the CMake mailing list