[Qbs] Qbs: how to use a pre-build script

Timur Kristóf timur.kristof at gmail.com
Fri May 26 18:17:12 CEST 2017


Hi,

What is the correct way to execute a pre-build script with Qbs whose
output is a dependency to the product being built?

For example, I have a script that generates a C++ header file
containing the current git revision and the date of the build. This
header is then included into one of the C++ source files of the
product. How do I execute this script before compiling the product?

I could try to create a Rule item, but I'm not sure how to make sure
that the rule is executed before the project is compiled. Or should I
create a separate Product and make the main Product depend on that?

Thanks in advance!
Cheers,
Timur



More information about the Qbs mailing list