User:Tshead/OSX CPack Bundle Generator: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: == OverView == Using CMake, I support several cross-platform projects that are deployed on Linux, OSX, and Windows. Some of these projects use Qt, others use GTK. On OSX, I prefer distr...)
 
mNo edit summary
Line 6: Line 6:


== Prototype ==
== Prototype ==
You can get a patch for CMake that includes the prototype bundle generator from the CMake bugtracker at http://public.kitware.com/Bug/view.php?id=7170


== Required CMake Variables ==
== Required CMake Variables ==

Revision as of 15:42, 6 June 2008

OverView

Using CMake, I support several cross-platform projects that are deployed on Linux, OSX, and Windows. Some of these projects use Qt, others use GTK. On OSX, I prefer distribution via "bundles" over PackageMaker, but I require more flexibility than the OSXX11 generator provides. For example, projects based on Qt don't need / don't want the functionality to auto-start X11 when the bundle is opened. Other projects need to run a shell-script at startup to setup a special environment. Some projects require an Info.plist that is more complex than that provided via the current generator.

To do this in the past, I've used "CreateBundle.sh.in" custom shell scripts to do the work of creating bundles, but this is repetitive and error-prone, and it does not integrate well with CMake INSTALL() functionality. What's needed is a more flexible OSX bundle generator for CPack.

Prototype

You can get a patch for CMake that includes the prototype bundle generator from the CMake bugtracker at http://public.kitware.com/Bug/view.php?id=7170

Required CMake Variables

The prototype bundle generator uses the following variables:

  • CPACK_PACKAGE_FILE_NAME - provides the name of the final compressed disk image (the name of the file that is distributed).
  • CPACK_PACKAGE_ICON - provides the icon for the mounted disk image (appears after the user mounts the disk image).
  • CPACK_BUNDLE_NAME - provides the bundle name (displayed in the finder underneath the bundle icon).
  • CPACK_BUNDLE_ICON - provides the bundle icon (displayed in the /Applications folder, on the dock, etc).
  • CPACK_BUNDLE_PLIST - path to a file that will become the bundle plist (hard-coded, generated-elsewhere via CONFIGURE_FILE(), etc).
  • CPACK_BUNDLE_STARTUP_COMMAND - path to a file that will be executed when the user opens the bundle. Could be a shell-script or a binary.