Results 1 to 6 of 6

Thread: Copy files to a subfolder of output dir qmake

  1. #1
    Join Date
    Jul 2012
    Posts
    20
    Thanks
    8
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4

    Default 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:
    Qt Code:
    1. EXTRA_BINFILES += $$PWD/log/myfiles.txt
    2. for(FILE,EXTRA_BINFILES){
    3. QMAKE_POST_LINK += $$quote(cp $${FILE} $$OUT_PWD$$escape_expand(\n\t))
    4. }
    To copy to clipboard, switch view to plain text mode 
    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 ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Copy files to a subfolder of output dir qmake

    Add a command to create the target directory and use the correct cp command and you will get the file copied to the correct location. At the moment you are asking cp to to copy the file into $$OUT_PWD and complaining that it does.

  3. #3
    Join Date
    Jul 2012
    Posts
    20
    Thanks
    8
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4

    Default Re: Copy files to a subfolder of output dir qmake

    I tried this:
    Qt Code:
    1. EXTRA_BINFILES += $$PWD/log/myfiles.txt
    2. EXTRA_OUT_FILES += $$OUT_PWD/log/
    3. for(FILE,EXTRA_BINFILES){
    4. QMAKE_POST_LINK += $$quote(cp $${FILE} $$EXTRA_OUT_FILES$$escape_expand(\n\t))
    5. }
    To copy to clipboard, switch view to plain text mode 
    And also create subfolder log under built dir (manually create, not use command in .pro file)
    Still not work

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Copy files to a subfolder of output dir qmake

    QMAKE_POST_LINK should contain a composite variable name that defines actions that need to be taken, not the actual commands.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Nov 2012
    Posts
    1
    Platforms
    Windows

    Default Re: Copy files to a subfolder of output dir qmake

    I'm new to this site and i saw a game i could download for free, is that legal for me to do, i saw other websites saying the game is not free, but i saw it on here, so what can you tell me?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Copy files to a subfolder of output dir qmake

    Quote Originally Posted by justgoinmyway25612 View Post
    I'm new to this site and i saw a game i could download for free, is that legal for me to do, i saw other websites saying the game is not free, but i saw it on here, so what can you tell me?
    And how is this related to this thread?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 20th July 2012, 11:46
  2. qmake to copy bash scripts and other files
    By Nitz in forum Installation and Deployment
    Replies: 3
    Last Post: 27th January 2009, 22:46
  3. Mac: Copy Files Build Phase and qmake...
    By kuwan in forum Qt Programming
    Replies: 4
    Last Post: 25th September 2007, 20:59
  4. qmake, uic and moc output folders
    By gri in forum Qt Programming
    Replies: 2
    Last Post: 30th March 2007, 18:55
  5. qmake and debug output
    By mattie in forum Qt Programming
    Replies: 7
    Last Post: 18th September 2006, 22:33

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.