[CMake] Setting the and Icon for a Windows Executable

Michael Jackson mike.jackson at bluequartz.net
Fri Aug 21 15:55:13 EDT 2009


I was actually looking for the procedure for Qt 4.5. I think I found  
what I need in the CMake sources but in the CMakeSetup.rc file there  
is the following:

IDI_ICON1   ICON  DISCARDABLE  "CMakeSetup.ico"

I grepped for IDI_ICON1 but didn't find anything being defined any  
where. Also, if my icon is located in ${PROJECT_SOURCE_DIR}/Resources/ 
icons/ico/Project.ico what would be the correct way to reference that  
in the .rc file?


_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio

On Aug 21, 2009, at 3:48 PM, David Cole wrote:

> Add a *.rc file to your ADD_EXECUTABLE sources.
>
> In the *.rc file, add a line that references the ico file:
> IDR_MAINFRAME           ICON                    "res\ 
> \CMakeSetupDialog.ico"
>
> (In this example, IDR_MAINFRAME is a #define that gives an integer  
> identifier for the ico resource.)
>
> See CMake/Source/MFCDialog/CMakeLists.txt and CMakeSetup.rc for an  
> example.
>
>
> HTH,
> David
>
>
> On Fri, Aug 21, 2009 at 3:33 PM, Michael Jackson <mike.jackson at bluequartz.net 
> > wrote:
> What would be the "cmake" way of setting an icon (.ico file) as the  
> icon for an executable?
>
>
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



More information about the CMake mailing list