MantisBT - CMake
View Issue Details
0004068CMakeCMakepublic2006-11-23 02:032011-04-04 12:00
Christian Ehrlicher 
Bill Hoffman 
lowfeaturealways
closedfixed 
 
CMake 2.8.4 
0004068: rc-File support for MinGW
According the request for bcc32 (http://www.cmake.org/Bug/bug.php?op=show&bugid=2738&pos=16 [^]) I would like to have built-in support for .rc-files with mingw. Currently I add a custom build rule (see attached testcase) but it would be nice if it works without this workaround.
No tags attached.
related to 0000369closed Bill Hoffman rc (ressource) file and CYGWIN 
zip test.zip (12,874) 1969-12-31 19:00
https://public.kitware.com/Bug/file/747/test.zip
patch rc-mingw.patch (1,065) 2008-11-06 08:13
https://public.kitware.com/Bug/file/1833/rc-mingw.patch
patch 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.patch (4,293) 2009-12-18 18:32
https://public.kitware.com/Bug/file/2730/0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.patch
patch 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.new.patch (4,206) 2010-08-15 13:39
https://public.kitware.com/Bug/file/3318/0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.new.patch
Issue History
2008-11-06 08:13Maik BeckmannFile Added: rc-mingw.patch
2008-11-06 08:15Maik BeckmannNote Added: 0014048
2008-11-06 08:21Maik BeckmannNote Added: 0014049
2008-11-26 07:10Axel DörflerNote Added: 0014194
2009-12-18 18:30Peter CollingbourneNote Added: 0018950
2009-12-18 18:32Peter CollingbourneFile Added: 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.patch
2010-05-27 10:26Sergey BelyashovNote Added: 0020843
2010-05-31 11:16Peter CollingbourneNote Added: 0020875
2010-08-15 13:39Peter CollingbourneFile Added: 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.new.patch
2010-08-15 13:41Peter CollingbourneNote Added: 0021763
2010-10-29 11:13Adam J RichardsonNote Added: 0022752
2010-11-05 06:37Adam J RichardsonNote Added: 0022891
2010-11-10 13:08David ColeTarget Version => CMake 2.8.4
2010-11-10 13:08David ColeDescription Updated
2010-12-07 17:12David ColeRelationship addedrelated to 0000369
2010-12-28 11:04Bill HoffmanNote Added: 0024332
2010-12-28 11:04Bill HoffmanStatusassigned => resolved
2010-12-28 11:04Bill HoffmanResolutionopen => fixed
2011-04-04 12:00David ColeNote Added: 0026078
2011-04-04 12:00David ColeStatusresolved => closed

Notes
(0014048)
Maik Beckmann   
2008-11-06 08:15   
rc-match.patch for CVS HEAD.

Changing CMakeLists.txt in test.zip to
{{{
cmake_minimum_required(VERSION 2.6)
project(test)

if(MINGW)
  set(CMAKE_RC_COMPILER_INIT windres)
  ENABLE_LANGUAGE(RC)
  SET(CMAKE_RC_COMPILE_OBJECT
    "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
endif(MINGW)


# sim executable
ADD_EXECUTABLE(test WIN32
  test.cpp
  test.rc
)
}}}

makes it work.

 -- Maik
(0014049)
Maik Beckmann   
2008-11-06 08:21   
I didn't try but I expect adding
{{{
if(MINGW)
  set(CMAKE_RC_COMPILER_INIT windres)
  ENABLE_LANGUAGE(RC)
  SET(CMAKE_RC_COMPILE_OBJECT
    "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
endif(MINGW)
}}}
to Modules/Platform/Windows-gcc breaks the compiler checks if windres isn't in the mingw bin directory. Thus I omitted these changes to Windows-gcc.cmake.

 -- Maik
(0014194)
Axel Dörfler   
2008-11-26 07:10   
When I add the changes as proposed above, I get a "CMAKE_RC_CREATE_SHARED_LIBRARY missing but required variable" error.
(0018950)
Peter Collingbourne   
2009-12-18 18:30   
I have developed another patch to add this feature (attached, 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.patch) which applies to the current CVS HEAD. The advantage of this patch is that there is no need to include any specific code in the CMakeLists.txt file.
(0020843)
Sergey Belyashov   
2010-05-27 10:26   
I try cmake-2.8.1 and cmake-2.8.0. Both has problems with windres & mingw. Moreover git master has no any changes for related files.
(0020875)
Peter Collingbourne   
2010-05-31 11:16   
My patch still applies cleanly to the current git next branch. It would be great if a developer could look at pushing this patch.
(0021763)
Peter Collingbourne   
2010-08-15 13:41   
I updated my patch to apply cleanly to the master branch. The new patch is 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.new.patch .
(0022752)
Adam J Richardson   
2010-10-29 11:13   
I just noticed this on my Windows XP SP3, g++ 4.4.1 build slave. My DLL was quietly building without its RC file until I applied Maik's patch to my CMakeLists.txt. Thanks Maik.
(0022891)
Adam J Richardson   
2010-11-05 06:37   
Seems to work better if you tell windres it's outputting a COFF object:

set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
(0024332)
Bill Hoffman   
2010-12-28 11:04   
Thanks for the patch, I just pushed changes based on the patch to next in git.
(0026078)
David Cole   
2011-04-04 12:00   
Closing resolved issues that have not been updated in more than 3 months.