I have a CMakeLists.txt script that creates the MACOSX_BUNDLE , although I find it difficult to find the "right path" to get the icon file in the package resources directory. I set the icon set properties with the following options:
# set icon set( ICON_NAME "MyApp.icns" ) set( ICON_PATH "${PROJECT_SOURCE_DIR}/../data/${ICON_NAME}" ) set_target_properties( MyApp PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME} )
It seems that the right way (as indicated in this present report ):
set_source_files_properties( ${ICON_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
However, there is no MyApp.app/Contents/Resources or MyApp.icns not copied .. The following is (in my opinion) a workaround:
file( COPY ${ICON_PATH} DESTINATION "MyApp.app/Contents/Resources/" )
Since I will often copy things into the resouces folder, I would prefer to do this in the โright wayโ, but can anyone tell me why this does not work, since I did it above?
source share