MantisBT - CMake
View Issue Details
0015103CMakeCMakepublic2014-08-25 06:252015-03-02 08:57
Hendrik Sattler 
Stephen Kelly 
normalmajoralways
closedfixed 
CMake 3.0 
CMake 3.0.2 
0015103: AUTORCC fails with more than one .qrc file per target
Using VisualStudio 2010.

9> qrc_icons.cpp
9> qrc_moreicons.cpp
9>qrc_moreicons.obj : error LNK2005: "int __cdecl qInitResources(void)" (?qInitResources@@YAHXZ) already defined in qrc_moreicons.obj
9>qrc_moreicons.obj : error LNK2005: "int __cdecl qCleanupResources(void)" (?qCleanupResources@@YAHXZ) already defined in qrc_moreicons.obj
9>qrc_moreicons.obj : error LNK2005: "class qCleanupResources__dest_class__ qCleanupResources__dest_instance__" (?qCleanupResources__dest_instance__@@3VqCleanupResources__dest_class__@@A) already defined in qrc_moreicons.obj
set ( CMAKE_AUTORCC ON )

and remove the qt4_add_resources() macro call.

I use this on 2 shared library target and one executable and in all three cases it fails.
Previously, _all_ .qrc file were in _one_ qt4_add_resources() macro call.
The Qt rcc does automatically prepend the file base name to the symbol, so

int QT_MANGLE_NAMESPACE(qInitResources_icons)()
and
int QT_MANGLE_NAMESPACE(qInitResources_moreicons)()

instead of twice
int QT_MANGLE_NAMESPACE(qInitResources)()
No tags attached.
Issue History
2014-08-25 06:25Hendrik SattlerNew Issue
2014-08-27 09:21Brad KingAssigned To => Stephen Kelly
2014-08-27 09:21Brad KingStatusnew => assigned
2014-09-09 18:50Stephen KellyNote Added: 0036765
2014-09-09 18:50Stephen KellyStatusassigned => resolved
2014-09-09 18:50Stephen KellyFixed in Version => CMake 3.0.2
2014-09-09 18:50Stephen KellyResolutionopen => fixed
2015-03-02 08:57Robert MaynardNote Added: 0038109
2015-03-02 08:57Robert MaynardStatusresolved => closed

Notes
(0036765)
Stephen Kelly   
2014-09-09 18:50   
Fixed in March. Part of the next release.

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=261acd91 [^]
(0038109)
Robert Maynard   
2015-03-02 08:57   
Closing resolved issues that have not been updated in more than 4 months.