Important: Please read the Qt Code of Conduct -

Detect modified files during qmake

  • How does qt detect if the build is necessary or not, e.g. if a source file or in my case a resource file (.qrc) was modified after the last build? Is there a flag for each file?
    What I exactly want to do is, to send a system command for resource compilation by adding this to the .pro file:
    system(rcc -binary -no-compress resource.qrc -o resource.rcc)
    And I want to do it only if the resource.qrc file modified after the last qmake. Is that possible and how?

    Final version should be: if(resource_modified) {COMPILE RESOURCE}

  • Lifetime Qt Champion

    For source files (c/c++) it is not the job for qmake - this is done by make.
    For built in resource files it is probably the same - make detects whether the resource file was changed or not.

  • @jsulm
    I need it for the rcc command. Whenever I run rcc in terminal, the binary output is re-generated, although the .qrc is the same.

    Is there a way to check it in qmake for example? Like a flag?
    Thanks in advance!