I am trying to specify an image which is used by CPack/NSIS to create an application symbol. It should be displayed in the start menu folder, as desktop icon and in the apps & features menu. What I know so far is:
# Icon displayed inside the installer on top left
set(CPACK_PACKAGE_ICON ""${CMAKE_CURRENT_SOURCE_DIR}/images\\\\Icon.bmp")
# Icon visible in Taskbar at installation, same for CPACK_NSIS_MUI_UNIICON
set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/images/Install_Icon.ico")
I already tried the parameters CPACK_NSIS_MUI_HEADERIMAGE,
set(CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${PROJECT_NAME}.exe)
and everything on google page 1+2 what get's shown for a combination of cpack, icon, desktop shortcut, ... Does anyone know how this works? Or is a special format/size needed?
I figured it out thanks to the comment of @Developer Paul. CPack and NSIS are misleading here because the different options to link to icons and images suggest that it's a setting you make through them. Actually the application icon is set with a resource file (.rc) under windows, so you have 3 files: your CMakeLists.txt, the Icon.ico and the AppIcon.rc.
In your CMakeLists.txt link to the .rc file
add_executable("${PROJECT_NAME}" helloworld.cpp AppIcon.rc)
The .rc contains only the link to your .ico, like this:
IDI_ICON1 ICON DISCARDABLE "images/icon.ico"
In my case I have a separate images folder in my project folder. And that's basically it. BUT this solution seems to work only for windows, for Linux you have to do it differently.