View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004068CMakeCMakepublic2006-11-23 02:032011-04-04 12:00
ReporterChristian Ehrlicher 
Assigned ToBill Hoffman 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionCMake 2.8.4Fixed in Version 
Summary0004068: rc-File support for MinGW
DescriptionAccording 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.
TagsNo tags attached.
Attached Fileszip file icon test.zip [^] (12,874 bytes) 1969-12-31 19:00
patch file icon rc-mingw.patch [^] (1,065 bytes) 2008-11-06 08:13 [Show Content]
patch file icon 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.patch [^] (4,293 bytes) 2009-12-18 18:32 [Show Content]
patch file icon 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.new.patch [^] (4,206 bytes) 2010-08-15 13:39 [Show Content]

 Relationships
related to 0000369closedBill Hoffman rc (ressource) file and CYGWIN 

  Notes
(0014048)
Maik Beckmann (reporter)
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 (reporter)
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 (reporter)
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 (developer)
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 (reporter)
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 (developer)
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 (developer)
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 (reporter)
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 (reporter)
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 (manager)
2010-12-28 11:04

Thanks for the patch, I just pushed changes based on the patch to next in git.
(0026078)
David Cole (manager)
2011-04-04 12:00

Closing resolved issues that have not been updated in more than 3 months.

 Issue History
Date Modified Username Field Change
2008-11-06 08:13 Maik Beckmann File Added: rc-mingw.patch
2008-11-06 08:15 Maik Beckmann Note Added: 0014048
2008-11-06 08:21 Maik Beckmann Note Added: 0014049
2008-11-26 07:10 Axel Dörfler Note Added: 0014194
2009-12-18 18:30 Peter Collingbourne Note Added: 0018950
2009-12-18 18:32 Peter Collingbourne File Added: 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.patch
2010-05-27 10:26 Sergey Belyashov Note Added: 0020843
2010-05-31 11:16 Peter Collingbourne Note Added: 0020875
2010-08-15 13:39 Peter Collingbourne File Added: 0001-Added-support-for-windres-in-MinGW-and-MSYS-makefile.new.patch
2010-08-15 13:41 Peter Collingbourne Note Added: 0021763
2010-10-29 11:13 Adam J Richardson Note Added: 0022752
2010-11-05 06:37 Adam J Richardson Note Added: 0022891
2010-11-10 13:08 David Cole Target Version => CMake 2.8.4
2010-11-10 13:08 David Cole Description Updated
2010-12-07 17:12 David Cole Relationship added related to 0000369
2010-12-28 11:04 Bill Hoffman Note Added: 0024332
2010-12-28 11:04 Bill Hoffman Status assigned => resolved
2010-12-28 11:04 Bill Hoffman Resolution open => fixed
2011-04-04 12:00 David Cole Note Added: 0026078
2011-04-04 12:00 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team