The resource compiler uses the same include directories as the C++ compiler.<div><br></div><div>So, if ${PROJECT_SOURCE_DIR} is in your include directories list, then reference it as "Resources\\icons\\ico\\Project.ico"<br>
<div><br></div><div>If IDI_ICON1 is not defined, then the resource compiler still works and does not complain, but the icon is identified by a string instead of a number. If you open up the executable with the "resource editor" of Visual Studio you will see it labeled with a double-quoted string : "IDI_ICON1"<br>
<br></div><div><br></div><div><br><div class="gmail_quote">On Fri, Aug 21, 2009 at 3:55 PM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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:<br>
<br>
IDI_ICON1 ICON DISCARDABLE "CMakeSetup.ico"<br>
<br>
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?<div class="im">
<br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer Dayton, Ohio<br>
<br></div><div><div></div><div class="h5">
On Aug 21, 2009, at 3:48 PM, David Cole wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Add a *.rc file to your ADD_EXECUTABLE sources.<br>
<br>
In the *.rc file, add a line that references the ico file:<br>
IDR_MAINFRAME ICON "res\\CMakeSetupDialog.ico"<br>
<br>
(In this example, IDR_MAINFRAME is a #define that gives an integer identifier for the ico resource.)<br>
<br>
See CMake/Source/MFCDialog/CMakeLists.txt and CMakeSetup.rc for an example.<br>
<br>
<br>
HTH,<br>
David<br>
<br>
<br>
On Fri, Aug 21, 2009 at 3:33 PM, Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> wrote:<br>
What would be the "cmake" way of setting an icon (.ico file) as the icon for an executable?<br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer Dayton, Ohio<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div></div>