[cmake-developers] Making GUI applications by default

Stephen Kelly steveire at gmail.com
Mon Mar 5 10:12:01 EST 2012


Eric Noulard wrote:

> 2012/3/5 Stephen Kelly <steveire at gmail.com>:
>> Clinton Stimpson wrote:
>>
>>>> I happened to read a little bit about CPack recently
>>>>
>>>> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overview
>>>>
>>>> The recommendation is to not use MACOSX_BUNDLE when using cpack,
>>>
>>> I don't see that as a general recommendation for GUI applications on Mac
>>> OS X.
>>
>> Yes, my statement was a little over-general.
>>
>>> Its only true if you use the Bundle generator, which does the
>>> equivalent of the MACOSX_BUNDLE conversion at cpack time (not install
>>> time).  I wouldn't base a general statement on a generator where one has
>>> a broken "make install" just to make a cpack generator work.
>>>
>>> If you use any other cpack generator with a GUI application, you do use
>>> MACOSX_BUNDLE.
>>
>> I imagined that users could set the value of CMAKE_MACOSX_BUNDLE to True
>> by default, but False if ("${CPACK_GENERATOR}" STREQUAL "MACOSX_BUNDLE").
>>
>> Is that realistic? I don't really know much about cpack, bundles or Mac
>> OSX in general.
> 
> Not really, you may decide run MacOSXBundle CPack generator outside
> CMakeLists.txt
> i.e. at CPack time and not at CMake time:
> 
> cpack -G OSXX11

Right. Thanks for the info.

At the least, this does provide a hammer for projects to use if wanted 
though, right?

if (NOT MYPROJECT_BUILD_FOR_CPACK_BUNDLE)
  set(CMAKE_MACOSX_BUNDLE True)
endif()

cmake .. -DMYPROJECT_BUILD_FOR_CPACK_BUNDLE=True
cpack 

?

Thanks,

Steve.






More information about the cmake-developers mailing list