[CMake] Problems with Apple OSX Bundles

David Cole david.cole at kitware.com
Fri Apr 18 10:48:12 EDT 2008


Brad did some work recently where these properties can be specified as
target properties rather than global CMake variables like this. See CVS (or
2.6) cmake --help-properties for this information:

  MACOSX_BUNDLE
       Build an executable as an application bundle on Mac OS X.

       When this property is set to true the executable when built on Mac OS
       X will be created as an application bundle.  This makes it a GUI
       executable that can be launched from the Finder.

       The bundle Info.plist file is generated automatically.  The following
       target properties may be set to specify its content:
       MACOSX_BUNDLE_INFO_STRING

         MACOSX_BUNDLE_ICON_FILE
         MACOSX_BUNDLE_GUI_IDENTIFIER
         MACOSX_BUNDLE_LONG_VERSION_STRING
         MACOSX_BUNDLE_BUNDLE_NAME
         MACOSX_BUNDLE_SHORT_VERSION_STRING
         MACOSX_BUNDLE_BUNDLE_VERSION
         MACOSX_BUNDLE_COPYRIGHT

If you are using CMake 2.6 (or CVS CMake) then try using
SET_TARGET_PROPERTIES instead of setting the variables directly.


HTH,
David


On Fri, Apr 18, 2008 at 9:35 AM, Dieter Oberkofler <d.1234567890 at qualiant.at>
wrote:

>  I have tried but only the definitions of the last SET(MACOSX_BUNDLE_*)
> calls are used for both executables.
>
>
>  ------------------------------
> *From:* David Cole [mailto:david.cole at kitware.com]
> *Sent:* Friday, April 18, 2008 13:35
> *To:* d.1234567890 at qualiant.at
> *Cc:* CMake at cmake.org
> *Subject:* Re: [CMake] Problems with Apple OSX Bundles
>
> You need to do the SET calls *before* the ADD_EXECUTABLE calls. The
> ADD_EXECUTABLE uses the current value of those variables to configure an
> Info.plist file for a bundle app...
>
> HTH,
> David
>
>
> On Fri, Apr 18, 2008 at 3:23 AM, Dieter Oberkofler <
> d.1234567890 at qualiant.at> wrote:
>
> > I'm using CMake 2.4.4 on the Apple OSX platform and have problems in
> > getting
> > CMake to generate correct bundles when specifying more then one target
> > executable.
> >
> > In principle my CMakeLists.txt file looks as follows:
> > ...
> > ADD_EXECUTABLE(LJS_001, MACOSX_BUNDLE ...)
> > SET(MACOSX_BUNDLE_BUNDLE_NAME LJSApplication)
> > SET(MACOSX_BUNDLE_BUNDLE_GUI_IDENTIFIER "com.qualiant.LJS")
> > ...
> > ADD_EXECUTABLE(ODS_001, MACOSX_BUNDLE ...)
> > SET(MACOSX_BUNDLE_BUNDLE_NAME ODSExample)
> > SET(MACOSX_BUNDLE_BUNDLE_GUI_IDENTIFIER "com.qualiant.ODSExample")
> > ...
> >
> > When now building the two targets, only the bundle settings (e.g. the
> > MACOSX_BUNDLE_BUNDLE_GUI_IDENTIFIER values) from the last target are
> > used.
> >
> > What am I doing wrong?
> > What is the relationship between the executables and the bundle
> > definition?
> >
> > Any help is appreciated.
> >
> > Thank you,
> > -D
> >
> >
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080418/cc9be89c/attachment-0001.htm>


More information about the CMake mailing list