[CMake] Setting additional Plist values for OS X Bundle

Michael Jackson mike.jackson at bluequartz.net
Tue Aug 26 10:26:00 EDT 2014


Was hoping not to have to bring in a custom plist, but thanks for the heads up.

Mike Jackson


On Aug 25, 2014, at 1:48 PM, Clinton Stimpson <clinton at elemtech.com> wrote:

> On Monday, August 25, 2014 01:10:27 PM Michael Jackson wrote:
>> Are there are newer facilities in CMake 3.x that would allow me to add
>> additional Plist values to the standard Mac OS X bundle plist that gets
>> created?
>> 
>> I use the following code currently:
>> 
>> set_target_properties(${TARGET_NAME} PROPERTIES
>>     MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}${DBG_EXTENSION} Version
>> ${VERSION_STRING}, Copyright 2014 BlueQuartz Software."
>> MACOSX_BUNDLE_ICON_FILE ${ICON_FILE_NAME}
>>     MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME}${DBG_EXTENSION}"
>>     MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}${DBG_EXTENSION}
>> Version ${VERSION_STRING}" MACOSX_BUNDLE_BUNDLE_NAME
>> ${PROJECT_NAME}${DBG_EXTENSION}
>>     MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION_STRING}
>>     MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION_STRING}
>>     MACOSX_BUNDLE_COPYRIGHT "Copyright 2014, BlueQuartz Software. All
>> Rights Reserved." )
>> 
>> 
>> But I need to add the following to my plist:
>> 
>>    <key>NSHighResolutionCapable</key>
>>    <string>True</string>
>> 
>> 
>> Thanks for any help
>> --
>> Mike Jackson                 www.bluequartz.net
> 
> Even with CMake 2.x, you can make your own .plist.in copied from  
> CMake/Modules/MacOSXBundleInfo.plist.in, then add your part in there.
>     <key>NSHighResolutionCapable</key>
>     <string>True</string>
> 
> Then add one more line to your set of target properties:
> 
> MACOSX_BUNDLE_INFO_PLIST 
> "${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in"
> 
> - Clint



More information about the CMake mailing list