[QBS] (no subject)
Joerg Bornemann
joerg.bornemann at digia.com
Thu May 16 10:14:27 CEST 2013
On 15/05/2013 18:28, Kakadu wrote:
> Now qbs take source file and generates result in build folder. I have compiler which takes source files and places result always in the same folder. Is it possible to hack qbs to copy source file to build directory and built it there? How difficult is it?
You'd have to add a copy command before the actual compiler call.
Something like this:
---snip---
Rule {
...
prepare: {
...
var commands = [];
// copy source file
var cmd = new Command("cp", [input.fileName,
FileInfo.path(output.fileName));
commands.push(cmd);
// now the actual compiler call
cmd = new Command("g++", args);
commands.push(cmd);
return commands;
}
}
---snap---
Instead of calling cp you can use a JavaScript command and copy the file
via File.copy in a platform-independent way, if you want.
BR,
Joerg
More information about the Qbs
mailing list