MantisBT - CMake
View Issue Details
0012870CMakeModulespublic2012-01-10 07:292016-06-10 14:31
Sam Morris 
Kitware Robot 
normalminoralways
closedmoved 
CMake 2.8.5 
 
0012870: CMakeDetermineRCCompiler does not correctly identify GNU windres when cross-compiling
I'm cross compiling on Linux with CMAKE_SYSTEM_NAME set to Windows.

CmakeDetermineRCCompiler contains the following code:

GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
  SET(CMAKE_RC_OUTPUT_EXTENSION .obj)
ELSE()
  SET(CMAKE_RC_OUTPUT_EXTENSION .res)
ENDIF()

CMAKE_C_COMPILER is set to 'i686-w64-mingw32-windres', therefore the above code goes down the wrong branch, and ends up setting CMAKE_RC_OUTPUT_EXTENSION to '.res'.
I'm actually trying to debug a separate problem: nothing is processing Modules/Platform/Windows-windres.cmake and I don't know why. I mention this here because I see the above code was added in the same commit that Windows-windres.cmake was added: <http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2f308c8> [^]
No tags attached.
related to 0012480closed David Cole Cmake used invalid path to rc file. 
related to 0011773closed David Cole CMake ignore .RC files when cross building 
patch cmake-12870-1.patch (477) 2012-01-10 08:39
https://public.kitware.com/Bug/file/4181/cmake-12870-1.patch
Issue History
2012-01-10 07:29Sam MorrisNew Issue
2012-01-10 08:39Sam MorrisFile Added: cmake-12870-1.patch
2012-01-10 08:40David ColeAssigned To => David Cole
2012-01-10 08:40David ColeStatusnew => assigned
2012-01-10 08:40David ColeRelationship addedrelated to 0012480
2012-01-10 08:40Sam MorrisNote Added: 0028226
2012-01-10 08:41David ColeRelationship addedrelated to 0011773
2012-01-10 08:42David ColeNote Added: 0028227
2012-01-10 08:42Sam MorrisNote Added: 0028228
2012-01-10 09:25Sam MorrisNote Added: 0028230
2012-01-10 09:43Sam MorrisNote Added: 0028231
2012-08-13 15:12David ColeStatusassigned => backlog
2012-08-13 15:12David ColeNote Added: 0030598
2012-08-13 15:20David ColeAssigned ToDavid Cole =>
2016-06-10 14:28Kitware RobotNote Added: 0041963
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0028226)
Sam Morris   
2012-01-10 08:40   
That patch changes the test to use MATCHES instead.
(0028227)
David Cole   
2012-01-10 08:42   
Isn't this fixed already by this recent commit, which is now in the recently released CMake 2.8.7?

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ddb1e5b9a3eff941ad12d29609839871fe518ed [^]

Isn't this a duplicate of the bugs that I just related it to?
(0028228)
Sam Morris   
2012-01-10 08:42   
Could be. I'll test their patches and update.
(0028230)
Sam Morris   
2012-01-10 09:25   
The commit you pointed to resolves the issue I mentioned in 'additional information'. However, without my patch, CMAKE_RC_OUTPUT_EXTENSION is still set to '.res', which causes windres to output its files in RES format, not COFF. This will cause failure at link time, because GCC wants to link together COFF files, not RES--or so I believe; another bug prevents me from actually being able to link my project yet. I'll update this bug again once I can confirm whether this is the case or not.
(0028231)
Sam Morris   
2012-01-10 09:43   
I just realised that the command line arguments passed to windres always ensure that its output is in COFF format, so my patch is not necessary after all. However, the logic that sets the output extension in CmakeDetermineRCCompiler.rc remains. Since it's not necessary, perhaps it should just be removed?
(0030598)
David Cole   
2012-08-13 15:12   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041963)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.