MantisBT - CMake
View Issue Details
0011773CMakeCCMakepublic2011-01-27 22:002012-07-09 06:52
Dongsheng Song 
David Cole 
highmajoralways
closedduplicate 
 
CMake 2.8.7CMake 2.8.7 
0011773: CMake ignore .RC files when cross building
For example:

ADD_LIBRARY(freetds-ct SHARED freetds-ct.def freetds-ct.rc
        blk.c
        cs.c
        ct.c
        ctutil.c)

If I compile on Windows, CMake can use freetds-ct.rc, but when I do a cross compile on Linux:

CFLAGS="-m64" CXXFLAGS="-m64" LDFLAGS="-m64" RCFLAGS="-F pe-x86-64"\
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc

CMake ignore freetds-ct.rc silently.
No tags attached.
duplicate of 0012480closed David Cole Cmake used invalid path to rc file. 
related to 0012870closed Kitware Robot CMakeDetermineRCCompiler does not correctly identify GNU windres when cross-compiling 
patch fix_rc_support_workaround.patch (779) 2011-09-07 11:14
https://public.kitware.com/Bug/file/4048/fix_rc_support_workaround.patch
Issue History
2011-01-27 22:00Dongsheng SongNew Issue
2011-01-27 22:03Dongsheng SongNote Added: 0025116
2011-04-28 19:57Denis PesotskyNote Added: 0026284
2011-04-28 20:14Denis PesotskyNote Edited: 0026284bug_revision_view_page.php?bugnote_id=26284#r312
2011-04-28 21:33Denis PesotskyNote Edited: 0026284bug_revision_view_page.php?bugnote_id=26284#r313
2011-09-07 11:14VladislavFile Added: fix_rc_support_workaround.patch
2011-09-07 11:17VladislavNote Added: 0027392
2011-10-28 07:15David ColeTarget Version => CMake 2.8.7
2011-10-28 10:12David ColeAssigned To => David Cole
2011-10-28 10:12David ColeStatusnew => assigned
2011-10-28 10:13David ColeNote Added: 0027668
2011-10-28 10:13David ColeRelationship addedduplicate of 0012480
2011-10-28 10:13David ColeStatusassigned => resolved
2011-10-28 10:13David ColeFixed in Version => CMake 2.8.7
2011-10-28 10:13David ColeResolutionopen => duplicate
2012-01-10 08:41David ColeRelationship addedrelated to 0012870
2012-07-09 06:52David ColeNote Added: 0029947
2012-07-09 06:52David ColeStatusresolved => closed

Notes
(0025116)
Dongsheng Song   
2011-01-27 22:03   
Sorry, the category should be 'CMake'.
(0026284)
Denis Pesotsky   
2011-04-28 19:57   
(edited on: 2011-04-28 21:33)
Same here. Using following toolchain with cmake 2.8.4:

SET(CMAKE_SYSTEM_NAME Windows)

SET(CMAKE_C_COMPILER i486-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i486-mingw32-g++)
SET(CMAKE_RC_COMPILER i486-mingw32-windres)

SET(CMAKE_FIND_ROOT_PATH /usr/i486-mingw32 /home/obey/mingw32 )

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Following happens:

...
[100%] Building RC object src/CMakeFiles/../qfrost.dir/__/res/win_icon.rc.res
/usr/bin/i486-mingw32-windres: '/foCMakeFiles/../qfrost.dir/__/res/win_icon.rc.res': No such file
/usr/bin/i486-mingw32-windres: can't open `/foCMakeFiles/../qfrost.dir/__/res/win_icon.rc.res' for input
...

upd: uh, probably this is not related to this bag. WTF is /foCMakeFiles?

(0027392)
Vladislav   
2011-09-07 11:17   
Workaround for "/foCMakeFiles" bug.
Use attached patch ("fix_rc_support_workaround.patch") to file "/usr/share/cmake/Modules/CMakeRCInformation.cmake".

To fix original bug, need setup variable CMAKE_RC_COMPILER.
(0027668)
David Cole   
2011-10-28 10:13   
Monitor the related Duplicate bug for further information on when this gets fixed... It is presently under investigation.
(0029947)
David Cole   
2012-07-09 06:52   
Closing resolved issues that have not been updated in more than 4 months.