Hi,
in our project we need to generates several „*.cpp“ and „*.h“ files from one
input file ("*.db“).
In the input file we define a database table structure for multiple tables and
generate one cpp class
for each table definition.
The name of the generated cpp files is not known before we start the code
generator because the name
was defined in the input file.
Ex.: input: customer.db
output: parts.h, parts.cpp, orders.h, orders.cpp …
We also generate a text file with a list of all generated files. This text file
has a defined name.
Is there a way to compile all generated files in the current product after
running the code generator by appending the files from the
generated text file to the product files? Or do you have any other suggestions?
Any help would be appreciated.
Thanks
Sebastian
import qbs
import qbs.FileInfo
AucosDynamicLibrary {
name: "subcore"
Depends { name: "core" }
files: [
"*.db",
"*.cpp",
"*.h"
]
FileTagger {
patterns: ["*.db"]
fileTags: ["db"]
}
Rule {
inputs: ["db"]
outputArtifacts: [{filePath: FileInfo.baseName(input.filePath)+".txt"}]
outputFileTags: ["cpp"]
prepare: {
var awk = "awk"
var awkScript = project.path + "/../utils/sql/db2c++.awk";
var args = ["-f ", awkScript, "-v",
"prifile="+FileInfo.baseName(input.filePath)+".txt", input.filePath];
var cmd = new Command(awk, args);
cmd.workingDirectory = product.buildDirectory;
cmd.description = "generating C++ source";
return cmd;
}
}
Export { Depends { name: "core" } }
}
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ QBS mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qbs
