Search code examples
qtresourcesqmake

Resource compiling not invoked by qmake


There is a way to automatically trigger recompilation of resource files when some of the original resource files (icons, text files, etc.) are changed?

E.g. if I have a .pro file with

RESOURCES = something.qrc

and in the something.qrc file I have something like

   <RCC>
    <qresource prefix="/localfile">
        <file>shaders/mytextfile.fs</file>
    </qresource>
   </RCC>

If I change the mytextfile.fs file the generation of the qrc_something.cpp file is not triggered.


Solution

  • You could try to add the variable DEPENDPATH to your .pro:

    DEPENDPATH += ./path_to_my_qrc_files
    

    It tells QMake where to look for dependencies. It works for header files, I don't know for resources. May worth a try.