Qt5 override rcc command to get nice command output

To get a nicer output then “/usr/lib/x86_64-linux-gnu/qt5/bin/rcc -name qml res/qml.qrc -o qrc_qml.cpp” when compiling your resources, you can change the following in your .pro-file.

With the default .pro-File:

RESOURCES += res/qml.qrc

This outputs:

/usr/lib/x86_64-linux-gnu/qt5/bin/rcc -name qml res/qml.qrc -o qrc_qml.cpp

With theses changes in the .pro-File:

_RESOURCES += res/qml.qrc
new_rcc.output = qrc_${QMAKE_FILE_BASE}.cpp
new_rcc.commands = @echo "[RCC] $<" && rcc ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
new_rcc.input = _RESOURCES
QMAKE_EXTRA_COMPILERS += new_rcc

This outputs:

[RCC] res/qml.qrc

Have Fun!

This entry was posted in Misc. Bookmark the permalink.

One Response to Qt5 override rcc command to get nice command output

  1. Ephraim says:

    OK, there is a much better solution for this 🙂 ….
    Just add the following to your project file:

    CONFIG += silent

Leave a Reply

Your email address will not be published. Required fields are marked *