[CMake] OS-X app bundle - executable name vs bundle name

Mike Krus mike at mve.com
Wed Feb 5 04:08:10 EST 2014


Hi James

On 29 Jan 2014, at 15:12, James Turner <james.turner at kdab.com<mailto:james.turner at kdab.com>> wrote:
I’m experimenting with using Cmake’s bundle support on OS-X for a project. (Up until now I have assembled the bundle by hand using a separate script which also creates the DMG). I have the situation, that I need the executable name to be different to the bundle name. MACOSX_BUNDLE_BUNDLE_NAME lets met set the name that appears in the CFBundleName key of the Info.plist, but the generated bundle still has the name of the target.
sorry, don't know about that, would be good to find out though! You can change the bundle display name using a plist file but this won't change the actual bundle's "folder" name.

One more thing, is there a standard way to install other components inside the bundle? I have seen some examples on the web which hardcode the bundle name as the destination path, which feels a bit ugly. (I’m thinking about helper applications and dylibs here, as well as the .icns file)
I'm sure you can write lots of cmake commands to copy stuff across. We've resorted to using a python script which is called at the end of the build. It'll copy a lot of the things like icns files, the osg and qt plugins, some gdal data files, etc. This python script is run though cmake's CONFIGURE command to resolve lots of the build time paths and version numbers…

This produces a complete bundle but it's no relocatable as is. We use a bash script  (also processed via CONFIGURE) which runs a combination of qt's macdeployqt (for the qt frameworks), dylibbundler (from macport) and install_name_tool to make sure all the bundle is completely relocatable.
It'll will also codesign the whole lot and create a nice dmg for the install :-)



Mike

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140205/ad8bfb9f/attachment-0001.html>


More information about the CMake mailing list