Important: Please read the Qt Code of Conduct -

Copy files to a subfolder of output dir qmake

  • In my project, I want to copy several files to subfolder of output directory.
    I've searched and found an example:

    @EXTRA_BINFILES += $$PWD/log/myfiles.txt
    QMAKE_POST_LINK += $$quote(cp $${FILE} $$OUT_PWD$$escape_expand(\n\t))

    But that code above seems like copy myfiles.txt to output directory.
    I want myfiles.txt to copy to dir OUT_PWD/log/
    How can I do ?

  • Moderators

    Use a shell script and run it in QMAKE_POST_LINK. The only problem is - as usual - Windows, which will have to get a different script, since it's not compatible with posix.

    There is also the variable "DEPLOYMENT":, but it only works on CE and Symbian.

Log in to reply