PDA

View Full Version : Copy files to a subfolder of output dir qmake



vhptt
16th November 2012, 03:02
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 ?

ChrisW67
16th November 2012, 04:30
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.

vhptt
16th November 2012, 04:51
I tried this:

EXTRA_BINFILES += $$PWD/log/myfiles.txt
EXTRA_OUT_FILES += $$OUT_PWD/log/
for(FILE,EXTRA_BINFILES){
QMAKE_POST_LINK += $$quote(cp $${FILE} $$EXTRA_OUT_FILES$$escape_expand(\n\t))
}
And also create subfolder log under built dir (manually create, not use command in .pro file)
Still not work :(:(:(

wysota
16th November 2012, 05:26
QMAKE_POST_LINK should contain a composite variable name that defines actions that need to be taken, not the actual commands.

justgoinmyway25612
21st November 2012, 01:15
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?

wysota
22nd November 2012, 03:46
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?