Qt World Summit: Register Today!

How to reference generated files in a QRC file?

  • Hi,

    I was wondering whether someone would know how to 'properly' reference files that get automatically generated at build time?

    What I mean is that I, for example, have some language files (.qm files) that get generated and that I want to be able to reference in a QRC file.

    Right now, such a QRC file would look like:

        <qresource prefix="/">
            <file alias="my_qm_file">build/my_qm_file.qm</file>

    This particular file would sit in the root folder of my Qt project, project that would effectively be built (using CMake) in the build folder, hence I currently reference build in my QRC file.

    However, a colleague of mine needs to build several versions of my project and would therefore like to be able to build my project in say my_build, my_other_build, etc.

    So, when it comes to my QRC file, how can I make sure that the build system does indeed look for my_build/my_qm_file.qm, my_other_build/my_qm_file.qm, etc. and not always build/my_qm_file.qm?

    Cheers, Alan.

  • Ok, my colleague suggested using CMake's CONFIGURE_FILE and it's indeed working fine that way.

Log in to reply