Qmake Copy files in target directory



  • Hi all, this is my first post in this wonderful forum.

    I am trying to figure out how to achieve a simple platform independent file copy from the source directory to the directory where the executable is built.

    In the source tree we got several XML and XSD files that are referenced by the application at run-time using a relative path (data/ folder). It would be awesome to automatically have those files copied in the build directory so that debug works "out of the box" without manual interaction.

    In our development team we operate on heterogeneous setups (Win+MSVC, Win+MinGW, Linux), but we all use QtCreator with a qmake project.

    I have searched the forum for similar questions and found solutions which used INSTALLS, but our goal is to have those file copied in the debug directory not in a - yet to be defined - installation path.

    For instance, I have tried to put the following code in my .pro file and add a make install build step, but no install rules were generated in the Makefile.
    @install_it.path = %{buildDir}
    install_it.files +=
    %{sourceDir}/data/schema.xsd
    %{sourceDir}/data/file1.xsd
    %{sourceDir}/data/file2.xml

    INSTALLS += install_it@
    @mingw32-make[1]: Nothing to be done for `install'.@

    How should I proceed? I would really like to have this solved by simply extending the .pro file.
    As a possible alternative I am considering cmake, but I don't even know if it would make things simple.

    Thanks in advance for your help,

    Mauro


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.