[CMake] [Eclipse CDT4 Generator] issue finding windres.exe

Yegor Yefremov yegor_sub1 at visionsystems.de
Mon Jun 28 08:40:59 EDT 2010


>> I'm using CMake, MinGW and Eclipse as described here
>> http://www.cmake.org/Wiki/Eclipse_CDT4_Generator. In my project I
>> need to compile a resource file, so I've used the
>> add_custom_command() to achieve this. If I run make in MSYS it
>> succeeds, but running from Eclipse causes a problem, since Eclipse
>> cannot find windres.exe. How can I automatically provide a path to
>> windres.exe during the project generation or are there any other
>> solutions?  
> Use the "find_program" command to find the full path to windres, then
> use the result of that statement rather than just the hardcoded
> "windres" as the executable for your custom command.

find_program() still requires some valid PATH to search. If I manually
add PATH=c:\mingw\bin to Eclipse environment variables, the windres.exe
could be found without any problems. The best way where to let CMake
specify RC compiler path during generator creation using cmake-gui. What
about applying this patch: http://public.kitware.com/Bug/view.php?id=4068

Regards,
Yegor


More information about the CMake mailing list