Hi there,
a quick question. In FunctionCreateBlueBerryApplication.cmake there is:
- -----------------------------------------------------------------------
- Add executable icon (Mac)
- -----------------------------------------------------------------------
if(APPLE)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns") set_target_properties(${_APP_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns") file(COPY ${MACOSX_BUNDLE_ICON_FILE} DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.app/Contents/Resources/") file(INSTALL ${MACOSX_BUNDLE_ICON_FILE} DESTINATION "${_APP_NAME}.app/Contents/Resources/") endif()
endif()
However, the COPY command and INSTALL command is passing in the name of a target property as the name of the file. As far as I can tell, these are empty, and hence the icon is not copied.
Also, in my Info.plist file within the final bundle, produced as a result of the packaging process, the location of the icon file is given as the location of the file within the build tree, which is wrong when copied to another machine.
Should it be something like this:
- -----------------------------------------------------------------------
- Add executable icon (Mac)
- -----------------------------------------------------------------------
if(APPLE)
set(icon_name "icon.icns") set(icon_location ${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon_name}) if(EXISTS "${icon_location}") set_target_properties(${_APP_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE ${icon_name}) set_target_properties(${_APP_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE ${icon_location}) file(COPY ${icon_location} DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.app/Contents/Resources/") file(INSTALL ${icon_location} DESTINATION "${_APP_NAME}.app/Contents/Resources/") endif()
endif()
Also, for T13517, this was done for mitkWorkbench:
#Setting application icon for mac os x systems set_target_properties(mitkWorkbench PROPERTIES MACOSX_BUNDLE_ICON_FILE "icon.icns") if(APPLE) install(FILES "icons/icon.icns" DESTINATION "mitkWorkbench.app/Contents/Resources") endif(APPLE)
which seems to agree with the above proposal.
Please can someone check this, as I am unfamiliar with this stuff.
Thanks
Matt