<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>I&#39;ve seen that my win32 binaries crossbuilt with cmake do not have icons, so I googled around for this problem and I found this:</div>
<div><br></div>0011773: CMake ignore .RC files when cross building<br clear="all">
<br><div>It seems it&#39;s not yet solved, what I&#39;m asking here if there is a workaround, something like to build with a custom command the rc file (I can do it), and then add it to the project binary with add_executable (this doesn&#39;t work).</div>

<div><br></div></blockquote></div><div><br></div>Just to describe the problem with some additional details:<div><br></div><div>I added to my CMakeLists.txt:</div><div><br></div><div><div>add_custom_target(icon.o</div><div>
                  COMMAND ${CMAKE_RC_COMPILER} icon.rc icon.o</div><div>                  DEPENDS monitor.ico</div><div>                  SOURCES icon.rc</div><div>                  )</div></div><div><br></div><div>Then I tried to add it to the project both as &quot;source&quot; in add_executable( ... icon.o) (1), and as library in target_link_libraries (... icon.o) (2)</div>
<div><br></div><div>CMake give the following error for (1):</div><div><br></div><div><div>  Cannot find source file &quot;icon.o&quot;.  Tried extensions .c .C .c++ .cc .cpp</div><div>  .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx</div>
</div><div><br></div><div>And the following error for (2):</div><div><br></div><div><div>  Target &quot;icon.o&quot; of type UTILITY may not be linked into another target.  One</div><div>  may link only to STATIC or SHARED libraries, or to executables with the</div>
<div>  ENABLE_EXPORTS property set.</div></div><div><br></div><div>The &quot;right&quot; case, that is to add, WITHOUT any custom target, icon.rc to the add_executable() source list does produce an executable, but without icon (as detailed also in the error report on the cmake tracker)</div>
<div><br></div><div>-- <br>Thanks in advance,
<div> Gabry</div><div><br></div><div><br></div></div>