Cmake add application icon for windows
-
I know there are numerous postings on this subject, but I cant make any sense of what is being said.
Using qmake I have the following line in my .pro file
win32:RC_ICONS += dac1.icoWhat is the equivalent for cmake??
I am reading about adding icons in .qrc files, but this seems to be only for loading icons on widgets generated in the app. I am trying to set the icon that represents the .exe file and also magically shows up on all top level widgets. Do I need to make a .rcc file. If so, what would that file look like.
Any help would be welcome.
-
You will have to create your own rc file as e.g. explained here: http://cmake.3232098.n2.nabble.com/Setting-the-and-Icon-for-a-Windows-Executable-td3492141.html
-
Thanks for your advice. I have got it working. For others who may have this problem:
-
I created a file called icon.rc with the following two lines
#include <windows.h>
IDI_ICON1 ICON "dac1.ico" -
I added icon.rc to the call to qt_add_executable().
Note: It does not work if icon.rc is added to the qt_add_resources() call which is used when adding a Qt .qrc file)
-