MantisBT - CMake
View Issue Details
0012370CMakeCMakepublic2011-07-29 01:202012-02-06 06:07
simleb 
David Cole 
highmajoralways
closedfixed 
MacOS X10.6-7
CMake 2.8.5 
CMake 2.8.6CMake 2.8.6 
0012370: Space in MACOSX_BUNDLE target name yields PostBuild script error with Xcode generator
When using a space in the target name of a MACOSX_BUNDLE (for an OS X app, it's pretty common, e.g. "App Store" or "Photo Booth"…) and generating a Xcode project, then in Xcode the build fails because the post build script tries to make the target PostBuild.Name\ with\ spaces.$CONFIGURATION of the XCODE_DEPEND_HELPER.make makefile and I guess make doesn't like it.
See the 'additional informations' for the actual output.

Setting MACOSX_BUNDLE_BUNDLE_NAME to "My App" doesn't help. A solution could be to produce an app named based on MACOSX_BUNDLE_BUNDLE_NAME instead of the target name, so you can use a target name like "MyApp" and still get a proper "My App.app" executable.


This issue is new to CMake 2.8.5 to the best of my knowledge.

Tested on both Xcode 3.2.5 on OS X 10.6 and Xcode 4.1 on OS X 10.7

Using the makefiles generator, there is no issue. I get "My App.app".
For Xcode, the temporary workaround is to skip the space in the target name (like "MyApp").
1. add_executable("My App" MACOSX_BUNDLE …)

2. $ cmake . -G Xcode

3. Try to build in Xcode
echo "Depend check for xcode"
Depend check for xcode
cd /path/to/buildir && make -C /path/to/buildir -f /path/to/buildir/CMakeScripts/XCODE_DEPEND_HELPER.make PostBuild.My\ App.Debug
make[1]: *** No rule to make target `PostBuild.My App.Debug'. Stop.
make: *** [Demo] Error 2
Command /bin/sh failed with exit code 2
Xcode
patch 0001-xcode-Fix-bug-12370.patch (982) 2011-08-27 14:17
https://public.kitware.com/Bug/file/4026/0001-xcode-Fix-bug-12370.patch
Issue History
2011-07-29 01:20simlebNew Issue
2011-07-29 01:23simlebTag Attached: Xcode
2011-07-29 06:12David ColeAssigned To => David Cole
2011-07-29 06:12David ColeStatusnew => assigned
2011-08-27 14:17Johan BjörkFile Added: 0001-xcode-Fix-bug-12370.patch
2011-08-27 14:18Johan BjörkNote Added: 0027276
2011-08-31 11:10David ColeTarget Version => CMake 2.8.6
2011-09-05 13:24David ColeNote Added: 0027352
2011-09-05 13:24David ColeStatusassigned => resolved
2011-09-05 13:24David ColeFixed in Version => CMake 2.8.6
2011-09-05 13:24David ColeResolutionopen => fixed
2012-02-06 06:07David ColeNote Added: 0028491
2012-02-06 06:07David ColeStatusresolved => closed

Notes
(0027276)
Johan Björk   
2011-08-27 14:18   
Simple patch attached; don't use spaces in target names for the makefile generator.
(0027352)
David Cole   
2011-09-05 13:24   
Fix pushed to 'next'

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e05e0f1d2c63353e25675df5430e1cbcd909cf93 [^]
(0028491)
David Cole   
2012-02-06 06:07   
Closing resolved issues that have not been updated in more than 4 months.