[CMake] Add icon for OSX platform

Olivier Tournaire olitour at gmail.com
Thu Apr 24 05:41:28 EDT 2008


Hi all,

I a m trying to add an icon to my BUNDLE executable on OSX, but I cannot
figure how to do that. Here is the part of my CMakeLists.txt :

IF(UNIX)
    IF(APPLE)
        SET( MACOSX_BUNDLE_ICON_FILE "os_freebsd.icns" )
        ADD_EXECUTABLE(ViewerITK MACOSX_BUNDLE ${SRC_DIR}/main/viewer.cpp
${ALL_VIEWER_SOURCES} ${ALL_VIEWER_HEADERS} )
        #ADD_CUSTOM_COMMAND( TARGET ViewerITK POST_BUILD
            #COMMAND mkdir ARGS
${CMAKE_CURRENT_BINARY_DIR}/Release/ViewerITK.app/Contents/Resources
            #COMMAND cp ARGS ${MACOSX_BUNDLE_ICON_FILE}
${CMAKE_CURRENT_BINARY_DIR}/Release/ViewerITK.app/Contents/Resources )
    ELSE(APPLE)
        ADD_EXECUTABLE(ViewerITK ${SRC_DIR}/main/viewer.cpp
${ALL_VIEWER_SOURCES} ${ALL_VIEWER_HEADERS} )
    ENDIF(APPLE)
    ADD_DEFINITIONS(-Wall)
ENDIF(UNIX)


What am I doing wrong ?

Regards,

Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080424/0571d9eb/attachment.htm>


More information about the CMake mailing list