Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Copy files to a subfolder of output dir qmake
Qt 6.11 is out! See what's new in the release blog

Copy files to a subfolder of output dir qmake

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 3.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vhptt89
    wrote on last edited by
    #1

    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 ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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.

      (Z(:^

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved