[CMake] MingW Update for resource compilation.

Peter Collingbourne peter at pcc.me.uk
Sat Apr 10 14:03:05 EDT 2010


On Fri, Mar 05, 2010 at 10:20:06PM -0800, J Decker wrote:
> All of the examples indicating ENABLE_LANGUAGE(RC) have the compiler
> set afterwards, and it turns out that the following lines work much
> better...
> 
> I Added these to WIndows-GNU.cmake
> 
> SET(CMAKE_RC_COMPILER "windres")
> SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -O
> coff -o <OBJECT> <SOURCE>")
> ENABLE_LANGUAGE(RC)
> 
> 
> by specifying -O coff, it outputs .obj format file containing the
> resources, and the link works.
> 
> only thing that's really wrong with this is that <FLAGS> is the full
> set of C definitions, and it may be different with more or less in
> reality.

FYI: I developed a patch to CMake to add more comprehensive support
for windres.  The patch is available here:

http://www.cmake.org/Bug/view.php?id=4068

(see the 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.patch attachment)

Thanks,
-- 
Peter


More information about the CMake mailing list