From 14fb429df40b22fe685bec241986a7cb8e890f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 6 Feb 2020 13:23:33 +0100 Subject: [PATCH] doc: how to supply icons for Windows executables. --- doc/platforms-windows.dox | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/platforms-windows.dox b/doc/platforms-windows.dox index 4fccd0d7c..ee57638a9 100644 --- a/doc/platforms-windows.dox +++ b/doc/platforms-windows.dox @@ -124,6 +124,31 @@ much as possible: simply link to the @ref main "Corrade::Main" library, which will do needed conversion implicitly for you +@section platform-windows-icon Executable icon + +In order to supply an icon for the executable, make an `*.ico` file +(preferrably out of multiple different sizes) and create a `*.rc` file +referencing it. The first argument can be anything (it can be used for +retrieving the icon later at runtime via Windows APIs), Windows always pick the +first icon in the `*.rc` file for the executable. + +@code{.txt} +MYICON ICON "my-icon.ico" +@endcode + +Then add the `*.rc` file to your application sources and CMake will take care +of the rest: + +@code{.cmake} +if(CORRADE_TARGET_WINDOWS) + target_sources(my-application PRIVATE icon.rc) +endif() +@endcode + +Note that this doesn't have any effect on the *window* icon --- there it has to +be specified at runtime, for example via +@ref Platform::Sdl2Application::setWindowIcon(). + @section platform-windows-terminal-colors Colored terminal output There's two options for colored terminal output --- either using the classic