MantisBT - CMake
View Issue Details
0015644CMakeCMakepublic2015-07-09 08:082016-03-07 09:12
Lectem 
Brad King 
normalminoralways
closedfixed 
Debian
CMake 3.2.3 
CMake 3.5CMake 3.5 
0015644: AUTORCC not generating files with Qt 5.1
AUTORCC is not generating the qrc_*.cpp files, rcc isn't even called.
I suspect the problem coming from the fact that I'm getting an error while configuring the project :

/usr/lib/x86_64-linux-gnu/qt5/bin/rcc: Unknown option: '--list'

It is coming from this line : https://github.com/Kitware/CMake/blob/master/Source/cmQtAutoGenerators.cxx#L193 [^]

I don't understand what the script is trying to do since --list isn't available for qt4 nor qt5.

The resources are present, with the correct path.

It is working when using QT5_ADD_RESOURCES.
CMakeLists.txt :



set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)


find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
find_package(Qt5Multimedia REQUIRED)

add_executable(myexe main.cpp resource_file.qrc)


resource_file.qrc :

<!DOCTYPE RCC><RCC version="1.0">
<qresource>
    <file>images/copy.png</file>
    <file>images/cut.png</file>
    <file>images/new.png</file>
    <file>images/open.png</file>
    <file>images/paste.png</file>
    <file>images/save.png</file>
</qresource>
</RCC>

No tags attached.
related to 0015074closed Stephen Kelly Qt 5: resources aren't being updated when CMAKE_AUTORCC is used 
related to 0015523closed Brad King ninja AUTORCC with AUTOGEN_TARGET_DEPENDS generated resources 
Issue History
2015-07-09 08:08LectemNew Issue
2015-07-09 08:57Brad KingNote Added: 0039104
2015-07-09 11:42LectemNote Added: 0039108
2015-07-09 11:42LectemNote Edited: 0039108bug_revision_view_page.php?bugnote_id=39108#r1841
2015-07-09 11:50Brad KingRelationship addedrelated to 0015074
2015-07-09 11:50Brad KingRelationship addedrelated to 0015523
2015-07-09 12:49Brad KingNote Added: 0039109
2015-07-09 12:50Brad KingNote Added: 0039110
2015-07-10 05:31LectemNote Added: 0039120
2015-07-10 08:47Brad KingNote Added: 0039121
2015-07-10 08:47Brad KingAssigned To => Brad King
2015-07-10 08:47Brad KingStatusnew => resolved
2015-07-10 08:47Brad KingResolutionopen => fixed
2015-07-10 08:47Brad KingFixed in Version => CMake 3.3
2015-07-10 08:47Brad KingTarget Version => CMake 3.3
2015-07-10 08:47Brad KingSummaryAUTORCC not generating files => AUTORCC not generating files with Qt 5.1
2015-07-11 04:44Stephen KellyNote Added: 0039124
2015-07-13 08:58Brad KingNote Added: 0039130
2015-07-13 08:58Brad KingAssigned ToBrad King => Stephen Kelly
2015-07-13 08:58Brad KingStatusresolved => assigned
2015-07-13 08:58Brad KingResolutionfixed => open
2015-07-13 08:58Brad KingFixed in VersionCMake 3.3 =>
2015-07-13 08:58Brad KingTarget VersionCMake 3.3 => CMake 3.4
2015-08-03 13:30Brad KingNote Added: 0039224
2015-08-03 13:30Brad KingAssigned ToStephen Kelly =>
2015-08-03 13:30Brad KingStatusassigned => resolved
2015-08-03 13:30Brad KingResolutionopen => fixed
2015-08-03 13:30Brad KingFixed in Version => CMake 3.4
2015-10-29 09:12Brad KingNote Added: 0039702
2015-10-29 09:12Brad KingAssigned To => Brad King
2015-10-29 09:12Brad KingFixed in VersionCMake 3.4 => CMake 3.5
2015-10-29 09:12Brad KingTarget VersionCMake 3.4 => CMake 3.5
2016-03-07 09:12Robert MaynardNote Added: 0040632
2016-03-07 09:12Robert MaynardStatusresolved => closed

Notes
(0039104)
Brad King   
2015-07-09 08:57   
The "rcc" tool is supposed to have a --list option. For example, on my system:

$ /usr/lib/x86_64-linux-gnu/qt5/bin/rcc --help |grep list
  --list Only list .qrc file entries, do not generate code.

The CMake test suite covers AUTORCC for both Qt4 and Qt5:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/QtAutogen/CMakeLists.txt;hb=v3.3.0-rc3#l47 [^]
 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/QtAutogen/autorcc_depends/CMakeLists.txt;hb=v3.3.0-rc3#l1 [^]
(0039108)
Lectem   
2015-07-09 11:42   
Well by looking at the online help for qt5 http://doc.qt.io/qt-5/rcc.html [^] and qt4.8 http://doc.qt.io/qt-4.8/rcc.html [^] the tool doesn't support this option (anymore?)

(0039109)
Brad King   
2015-07-09 12:49   
It seems the option is not in the main documentation but is in the --help output since Qt 5.2:

 Port rcc to QCommandLineParser, 2013-08-08
 http://code.qt.io/cgit/qt/qtbase.git/diff/src/tools/rcc/main.cpp?id=4774ff8eb1 [^]

Prior to that it was "-list" and was not documented.
(0039110)
Brad King   
2015-07-09 12:50   
My version is 5.4:

 $ /usr/lib/x86_64-linux-gnu/qt5/bin/rcc --version
 rcc 5.4.2

What is your rcc version?
(0039120)
Lectem   
2015-07-10 05:31   
For the versions :

qtchooser -qt4 -run-tool=rcc -version
Qt Resource Compiler version 4.8.6

qtchooser -qt5 -run-tool=rcc -version
Qt Resource Compiler version 5.1.1

And to confirm that --list isn't available :

qtchooser -qt4 -run-tool=rcc --list
Qt resource compiler
/usr/lib/x86_64-linux-gnu/qt4/bin/rcc: Unknown option: '--list'
Usage: /usr/lib/x86_64-linux-gnu/qt4/bin/rcc [options] <inputs>

qtchooser -qt5 -run-tool=rcc --list
Qt resource compiler
/usr/lib/x86_64-linux-gnu/qt5/bin/rcc: Unknown option: '--list'

However -list seems to be recognized

rcc -list foo
/usr/lib/x86_64-linux-gnu/qt5/bin/rcc: File does not exist 'foo'
(0039121)
Brad King   
2015-07-10 08:47   
I switched to using -list instead of --list:

 cmQtAutoGenerators: Fix rcc invocation for Qt 5.0 and 5.1
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a271e13 [^]

I've also queued this for merge to the 'release' branch for 3.3.
(0039124)
Stephen Kelly   
2015-07-11 04:44   
This is equivalent to setting a policy to OLD. The compatibility flag handling will be removed in the future.

 https://bugreports.qt.io/browse/QTBUG-47157 [^]

Putting this in CMake 3.3 seems odd.
(0039130)
Brad King   
2015-07-13 08:58   
Re 0015644:0039124: Thanks. I've dropped the change to use -list from the queue for 3.3, but it is still in 'master'. Please extend the topic to switch the flag based on the rcc version or --help output or some other way of adapting.
(0039224)
Brad King   
2015-08-03 13:30   
Re 0015644:0039130: The originally reported issue has been resolved and will be fixed in CMake 3.4. Supporting future Qt versions that do not have the old "-list" by quering availability of "--list" is a separate development task. Therefore I'm marking this issue as resolved.
(0039702)
Brad King   
2015-10-29 09:12   
After discussion here:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14791/focus=14825 [^]

we decided not to unconditionally use the undocumented `rcc -list` option that will probably be removed in a future version of Qt. For the CMake 3.4 release we will go back to the 3.3 behavior of using the documented `rcc --list` option:

 Revert "cmQtAutoGenerators: Fix rcc invocation for Qt 5.0 and 5.1"
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b935db3a [^]

Now it is fixed properly in post-3.4 development and will be in 3.5:

 QtAutogen: Fix rcc invocation for Qt 5.0 and 5.1
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e78fcc63 [^]
(0040632)
Robert Maynard   
2016-03-07 09:12   
Closing resolved issues that have not been updated in more than 4 months.