Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-04 Thread Daniel Dekkers
I don't think you need the configure_file() command.

What happens now (if i understand correctly) is that:
1) a copy of Info.plist is made from CMAKE_CURRENT_SOURCE_DIR to 
CMAKE_CURRENT_BINARY_DIR
2) a copy of Info.plist is made from CMAKE_CURRENT_BINARY_DIR to 
path/to/build/CMakeFiles/[appname].dir

You should be able to just do...

set_target_properties( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_SOURCE_DIR}/Info.plist )
set_target_properties(${this_target} PROPERTIES RESOURCE "${RESOURCE_FILES}")

To add the Info.plist from CMAKE_CURRENT_SOURCE_DIR directly to your project. 
Unless, you would do something interesting in configure_file(), besides just 
copying.

Don't know if you can send an image as attachment to the mailing list. You can 
try ;-)

Thanks,
Daniel

On Oct 3, 2011, at 10:11 PM, g...@novadsp.com wrote:

I've modified the cmakelists file to include:

#---
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)

set_target_properties( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist )

set_target_properties(${this_target} PROPERTIES RESOURCE "${RESOURCE_FILES}")
#---

which seems OK with Cmake. Indeed files now seem to go into the correct Xcode 
folders. However there is still an oddity best demonstrated with a picture. 
Does this list accepts JPG/PNG attachments? Is this OK?

Thx++

Jerry

On 03/10/2011 15:49, Daniel Dekkers wrote:
>> set_target_properties(${this_target} PROPERTIES RESOURCE 
>> ${RESOURCE_FILES})< error here. wrong number of args
> 
> Maybe try "${RESOURCE_FILES)" (with quotes).
> That helps to get rid of the ; delimiters of CMake lists, if that is the 
> problem. And otherwise the quotes might "bundle" the contents of 
> RESOURCE_FILES to a single string value, because it now seems to interpret 
> them as different arguments. It works for me:
> 
> # Make sure these resources are labeled as such so they are treated correctly 
> (sometimes compiled and copied but at least copied to the bundle...)
> SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES RESOURCE "${ALL_RSRC_FILES}" )
> 
> 
> 
> 




--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-03 Thread g...@novadsp.com
Thanks all, the help is *very* much appreciated. I'll revise and report 
back.


On 03/10/2011 15:14, Richard Wackerbarth wrote:

I don't think that you want the SOURCE file in the bundle.

First, you need to process the source file with  configure_file():
Use ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist as input
and ${CMAKE_CURRENT_BINARY_DIR}/Info.plist as output.

Then you incorporate the configured version into the bundle:
set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)

On Oct 3, 2011, at 8:24 AM, g...@novadsp.com wrote:


set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)






--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-03 Thread Richard Wackerbarth
My apology ... I haven't kept up with the non-explicit implications of the 
Mac-specific properties.

On Oct 3, 2011, at 9:34 AM, David Cole wrote:

> On Mon, Oct 3, 2011 at 10:14 AM, Richard Wackerbarth  
> wrote:
> I don't think that you want the SOURCE file in the bundle.
> 
> First, you need to process the source file with  configure_file():
> Use ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist as input
> and ${CMAKE_CURRENT_BINARY_DIR}/Info.plist as output.
> 
> Then you incorporate the configured version into the bundle:
> set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
> ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
> 
> On Oct 3, 2011, at 8:24 AM, g...@novadsp.com wrote:
> 
> > set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
> > ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
> 
> --
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 
> 
> Either way should be fine. The MACOSX_BUNDLE_INFO_PLIST target property 
> specifies a customization or an override of the CMake provided built-in file 
> "MacOSXBundleInfo.plist.in". CMake itself will configure this file into the 
> bundle's Info.plist file. So there's no need for you to call configure_file 
> on it.
> 
> But if you do, CMake will do so again anyhow, and you should end up with the 
> same final result.
> 
> I'm looking at the code in "cmLocalGenerator::GenerateAppleInfoPList" to 
> derive this information... (Which is called from Makefile and Xcode 
> generators...)
> 
> 
> HTH,
> David
> 
> --
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-03 Thread David Cole
On Mon, Oct 3, 2011 at 10:14 AM, Richard Wackerbarth wrote:

> I don't think that you want the SOURCE file in the bundle.
>
> First, you need to process the source file with  configure_file():
> Use ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist as input
> and ${CMAKE_CURRENT_BINARY_DIR}/Info.plist as output.
>
> Then you incorporate the configured version into the bundle:
> set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST
> ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
>
> On Oct 3, 2011, at 8:24 AM, g...@novadsp.com wrote:
>
> > set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST
> ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
>
> --
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


Either way should be fine. The MACOSX_BUNDLE_INFO_PLIST target property
specifies a customization or an override of the CMake provided built-in file
"MacOSXBundleInfo.plist.in". CMake itself will configure this file into the
bundle's Info.plist file. So there's no need for you to call configure_file
on it.

But if you do, CMake will do so again anyhow, and you should end up with the
same final result.

I'm looking at the code in "cmLocalGenerator::GenerateAppleInfoPList" to
derive this information... (Which is called from Makefile and Xcode
generators...)


HTH,
David
--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-03 Thread Richard Wackerbarth
I don't think that you want the SOURCE file in the bundle.

First, you need to process the source file with  configure_file():
Use ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist as input
and ${CMAKE_CURRENT_BINARY_DIR}/Info.plist as output.

Then you incorporate the configured version into the bundle:
set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)

On Oct 3, 2011, at 8:24 AM, g...@novadsp.com wrote:

> set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
> ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)

--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-03 Thread g...@novadsp.com

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, g...@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:

...
CFBundleDisplayName
${APP_NAME}
...
CFBundleIdentifier
${APP_IDENTIFIER}
...

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.








--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-03 Thread Daniel Dekkers
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, g...@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:
>> 
>> ...
>>  CFBundleDisplayName
>>  ${APP_NAME}
>> ...
>>  CFBundleIdentifier
>>  ${APP_IDENTIFIER}
>> ...
>> 
>> 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.
> 
> 

--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-02 Thread g...@novadsp.com

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:

...
CFBundleDisplayName
${APP_NAME}
...
CFBundleIdentifier
${APP_IDENTIFIER}
...

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.


--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-02 Thread Daniel Dekkers
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:

...
CFBundleDisplayName
${APP_NAME}
...
CFBundleIdentifier
${APP_IDENTIFIER}
...

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,
Daniel Dekkers

On Oct 2, 2011, at 2:51 PM, g...@novadsp.com wrote:

> Hi Daniel, can you clarify this a bit? Do you have an example?
> 
> On 30/09/2011 15:23, Daniel Dekkers wrote:
>> Correction: not the Info.plist. That is treated differently because CMake 
>> generates its own for the project.
>> You can set a "template" Info.plist though where ${VARIABLE} entries are 
>> subsituted with (known) CMake variables.
>> 
>> On Sep 30, 2011, at 4:14 PM, Daniel Dekkers wrote:
>> 
> 
> Thx++
> 
> 

--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-10-02 Thread g...@novadsp.com

Hi Daniel, can you clarify this a bit? Do you have an example?

On 30/09/2011 15:23, Daniel Dekkers wrote:

Correction: not the Info.plist. That is treated differently because CMake 
generates its own for the project.
You can set a "template" Info.plist though where ${VARIABLE} entries are 
subsituted with (known) CMake variables.

On Sep 30, 2011, at 4:14 PM, Daniel Dekkers wrote:



Thx++


--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-09-30 Thread g...@novadsp.com

Hi Daniel

On 30/09/2011 15:14, Daniel Dekkers wrote:


I've been battling with .xibs for weeks. What I am finally doing now is not 
trying to compile and add them to the bundle via CMake myself using custom 
commands.
I just add them as sources to ADD_EXECUTABLE(... ${RESOURCES}) and set
SET_TARGET_PROPERTIES(... PROPERTIES RESOURCE ${RESOURCES}) to make Xcode 
"aware" of them.


They then appear in the top level /Resources folder and Xcode will 
compile them and place them in the bundle.


Excellent, thanks. That looks like the missing part of the puzzle. I 
will report back when I get a chance to try this.



--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-09-30 Thread Daniel Dekkers
Correction: not the Info.plist. That is treated differently because CMake 
generates its own for the project. 
You can set a "template" Info.plist though where ${VARIABLE} entries are 
subsituted with (known) CMake variables.

On Sep 30, 2011, at 4:14 PM, Daniel Dekkers wrote:

> Hi Jerry,
> 
> I've been battling with .xibs for weeks. What I am finally doing now is not 
> trying to compile and add them to the bundle via CMake myself using custom 
> commands.
> I just add them as sources to ADD_EXECUTABLE(... ${RESOURCES}) and set
> SET_TARGET_PROPERTIES(... PROPERTIES RESOURCE ${RESOURCES}) to make Xcode 
> "aware" of them. They then appear in the top level /Resources folder and 
> Xcode will compile them and place them in the bundle. The same with icons, 
> splashscreens, Info.plist, Settings.bundle, etc.
> 
> Two problems with that..
> - You need Xcode. Although i haven't tried building from the command line in 
> any way.
> - If you have multiple projects, each with it's own resources, they tend to 
> all clump together in the top level /Resources folder. Not what you want. I 
> haven't found a way to seperate them into the individual projects yet. Don't 
> even know if that is possible with Xcode.
> 
> Thanks,
> Daniel Dekkers
> 
> On Sep 30, 2011, at 3:22 PM, g...@novadsp.com wrote:
> 
>> My CMake rules to convert a .XIB file to a .NIB file in the application 
>> bundle work for makefile builds.
>> 
>> However I cannot get the same result when using the Xcode generator. Does 
>> anyone have a working example for XCode 3.X or 4 they can share?
>> 
>> The cmakelists.txt script is
>> 
>> Message("We are generating for Xcode ${this_target}")
>> 
>> # Make sure the '.App' directory tree is correctly created before we build
>> # copy our plist and icon file into place
>> add_custom_command (TARGET ${this_target} PRE_BUILD
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/MacOS
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj
>>COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
>>COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/WV.icns 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
>>)
>> 
>> # command to convert any existing IB .xib to .nib in the .APP folder
>> add_custom_command (TARGET ${this_target} POST_BUILD
>> COMMAND ${IBTOOL} --errors --warnings --notices 
>> --output-format human-readable-text
>> --compile  
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj/MainMenu.nib
>>  
>>${CMAKE_CURRENT_SOURCE_DIR}/MainMenu.xib
>>)
>> 
>> This appears to fail with at the first cp command ...
>> 
>> Thx++
>> 
>> Jerry
>> 
>> 
>> 
>> --
>> 
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
> 
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.8, Xcode generator and XIB files

2011-09-30 Thread Daniel Dekkers
Hi Jerry,

I've been battling with .xibs for weeks. What I am finally doing now is not 
trying to compile and add them to the bundle via CMake myself using custom 
commands.
I just add them as sources to ADD_EXECUTABLE(... ${RESOURCES}) and set
SET_TARGET_PROPERTIES(... PROPERTIES RESOURCE ${RESOURCES}) to make Xcode 
"aware" of them. They then appear in the top level /Resources folder and Xcode 
will compile them and place them in the bundle. The same with icons, 
splashscreens, Info.plist, Settings.bundle, etc.

Two problems with that..
- You need Xcode. Although i haven't tried building from the command line in 
any way.
- If you have multiple projects, each with it's own resources, they tend to all 
clump together in the top level /Resources folder. Not what you want. I haven't 
found a way to seperate them into the individual projects yet. Don't even know 
if that is possible with Xcode.

Thanks,
Daniel Dekkers

On Sep 30, 2011, at 3:22 PM, g...@novadsp.com wrote:

> My CMake rules to convert a .XIB file to a .NIB file in the application 
> bundle work for makefile builds.
> 
> However I cannot get the same result when using the Xcode generator. Does 
> anyone have a working example for XCode 3.X or 4 they can share?
> 
> The cmakelists.txt script is
> 
> Message("We are generating for Xcode ${this_target}")
> 
> # Make sure the '.App' directory tree is correctly created before we build
> # copy our plist and icon file into place
> add_custom_command (TARGET ${this_target} PRE_BUILD
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/MacOS
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj
> COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
> COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/WV.icns 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
> )
> 
> # command to convert any existing IB .xib to .nib in the .APP folder
> add_custom_command (TARGET ${this_target} POST_BUILD
>  COMMAND ${IBTOOL} --errors --warnings --notices 
> --output-format human-readable-text
>  --compile  
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj/MainMenu.nib
>  
> ${CMAKE_CURRENT_SOURCE_DIR}/MainMenu.xib
> )
> 
> This appears to fail with at the first cp command ...
> 
> Thx++
> 
> Jerry
> 
> 
> 
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake 2.8, Xcode generator and XIB files

2011-09-30 Thread g...@novadsp.com
My CMake rules to convert a .XIB file to a .NIB file in the application 
bundle work for makefile builds.


However I cannot get the same result when using the Xcode generator. 
Does anyone have a working example for XCode 3.X or 4 they can share?


The cmakelists.txt script is

Message("We are generating for Xcode ${this_target}")

# Make sure the '.App' directory tree is correctly created before we build
# copy our plist and icon file into place
add_custom_command (TARGET ${this_target} PRE_BUILD
 COMMAND mkdir -p 
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app
 COMMAND mkdir -p 
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
 COMMAND mkdir -p 
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/MacOS
 COMMAND mkdir -p 
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
 COMMAND mkdir -p 
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj
 COMMAND cp -n 
${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
 COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/WV.icns 
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources

 )

# command to convert any existing IB .xib to .nib in the .APP folder
add_custom_command (TARGET ${this_target} POST_BUILD
  COMMAND ${IBTOOL} --errors --warnings --notices 
--output-format human-readable-text
  --compile  
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj/MainMenu.nib 


 ${CMAKE_CURRENT_SOURCE_DIR}/MainMenu.xib
 )

This appears to fail with at the first cp command ...

Thx++

Jerry



--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake