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
    for(FILE,EXTRA_BINFILES){
    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":http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#deployment, but it only works on CE and Symbian.


Log in to reply
 

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