[CMake] OS X Icon file

Chuck Theobald chuckt at uoregon.edu
Fri Mar 9 15:46:50 EST 2012


Hello all,

How do I specify that my icon file (.icns) be installed to the correct 
location in an OS X bundle? So far, I've got:

IF ( ${CMAKE_HOST_APPLE} )
   message( "OS X build" )
   SET( CMAKE_CXX_FLAGS " -m32 ${CMAKE_CXX_FLAGS} " )
   SET( MACOSX_BUNDLE_INFO_STRING "MRIConvert - version 2.0" )
   SET( MACOSX_BUNDLE_BUNDLE_VERSION "2.0" )
   # Change following line to point to actual icns file in bundle.
   SET( MACOSX_BUNDLE_ICON_FILE "MRIConvert.icns" )
   SET( MACOSX_BUNDLE_GUI_IDENTIFIER "edu.uoregon.lcni.MRIConvert" )
   SET( MACOSX_BUNDLE_BUNDLE_NAME "MRIConvert" )
ENDIF ( ${CMAKE_HOST_APPLE} )

which creates the Info.plist file in the Contents directory. I've also 
got MACOSX_BUNDLE specified in my Add_Executable block, so the bundle 
hierarchy is created. Google does not know the answer.

Thank you,

-- 
Chuck Theobald
System Administrator
The Robert and Beverly Lewis Center for Neuroimaging
University of Oregon
P: 541-346-0343
F: 541-346-0345



More information about the CMake mailing list