CMake: Add Application Icon on Windows
When building for Windows, cmake generated executables do not contain application icon.
First, create an empty
.rc file in your project, say
bt.rc and fill with the following content:
IDI_ICON1 ICON DISCARDABLE "icon.ico"
icon.ico into the same folder. This is the folder where your
CMakeLists.txt should add the
.rc file as the last argument i.e.
add_executable (bt "bt.cpp" bt.rc)
Note that it cannot be in filters but has to be explicitly the last argument!
To contact me, send an email anytime or leave a comment below.