[CMake] CMake 2.8, Xcode generator and XIB files

g4 at novadsp.com g4 at novadsp.com
Mon Oct 3 09:24:29 EDT 2011


Hi Daniel

In a word: badly :(

1. I cannot get CMake to parse this:

# should end up in resources section
SET (RESOURCE_FILES ./WV.icns ./InfoPlist.strings ./MainMenu.xib 
./Info.plist)
# we want an OSX bundle
set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
# get CMake to generate the right XCode folder(s)
set_target_properties(${this_target} PROPERTIES RESOURCE 
${RESOURCE_FILES}) <---- error here. wrong number of args

2. The commands to set the strings in the PList file never appear to get 
executed. The content remains unchanged.

If you've got any clues please let me know.
On 03/10/2011 12:49, Daniel Dekkers wrote:
> Hi,
>
> Let me know how it works out for you...
> We will be writing an article about this subject (platform independence, OSX, iOS, Windows, mainly focussed on OpenGL/ES1/ES2) in the fall,
> so we need all the feedback we can get ;-)
>
> Thanks,
> Daniel Dekkers
>
> On Oct 2, 2011, at 6:27 PM, g4 at novadsp.com wrote:
>
>> Hi Daniel
>>
>> On 02/10/2011 15:03, Daniel Dekkers wrote:
>>> With...
>>>
>>> SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PLIST_TEMPLATE} )
>>>
>>> ... we set a path to a Info.plist template (we actually got separate ones for iOS and OSX). Maybe you can call them what you want, haven't tried. "Info.plist.in" would be good. I'll try.
>>> These templates look like normal property list files except that they can contain CMake variable names, something like this:
>>>
>>> ...
>>> 	<key>CFBundleDisplayName</key>
>>> 	<string>${APP_NAME}</string>
>>> ...
>>> 	<key>CFBundleIdentifier</key>
>>> 	<string>${APP_IDENTIFIER}</string>
>>> ...
>>>
>>> where ${APP_NAME} and ${APP_IDENTIFIER} are substituted by CMake automatically while a new Info.plist is generated in path/to/build//CMakeFiles/[APP_NAME].dir.
>>> This file is included in the Xcode project, it will appear in the Application->Resources folder. Not in the top level Resources folder of the project.
>>>
>>> I'm not exactly sure what triggers this CMake behavior, I guess "Xcode" generation always implies: "Info.plist" generation.
>>> Or it's dependent on another setting (platform, architecture). Couldn't find that in the documentation.
>>> But i was copying the Info.list myself (with ADD_CUSTOM_COMMAND) and that gave all kinds of problems, like code signing errors.
>>>
>>> I think it is possible to *not* let CMake perform the substitutions and just copy the template, but I haven't got that working yet. That would be handy because for some values you would just want to keep the ${...} entries unchanged. Xcode uses the same notation for values that are substituted later on.
>>>
>>> Also see
>>> https://lists.secondlife.com/pipermail/sldev/2008-September/011839.html
>>>
>>
>> Thanks for the detailed reply. I will try this.
>>
>>
>
>




More information about the CMake mailing list