[QBS] How to change build directory of a Product?

.Santanu Chakrabarti santanu.chakrabarti at gmail.com
Sat May 3 18:20:43 CEST 2014


I am Santanu from India, a software developer with more than 12yrs of
application development in Java. I am very much fond of the Gradle build
tool for Java due to the flexibility and ease of use that it provides. So
when recently I thought of making my hands dirty in developing application
in C language I started looking for a similar build tool. Then I come to
know about QBS, and at first sight it looked really promising.

But when I started using QBS with qtcreator I started facing the real
challenge. Its very simple to build and run a multi-file C/C++ project with
QBS with the default configuration. But when one goes to configure the
product/project according to one's desire there starts the frustration. So
here are some queries I am struggling with at present.
1. How to change the name of default build directory? I found in
documentation that there is a buildDirectory property for Product item. But
when I set the value of this property for CppApplication in QBS build
script, qtcreator throws error that the property is not declared.
2. I have found that the object file that is getting created if I build the
QBS project has the name "XXXXX.c.o" if the file name is "XXXXX.c". How can
I configure QBS to name the object file as "XXXXX.o"?
3. Moreover the object files are getting generated in a folder ".obj" in
the default build directory. How to configure this also?

I am new to QBS as well as writing applications in C so any help regarding
my above queries would be much appreciated. I shall also like to make some
observations on QBS build system and its documentation.
1. I believe QBS is a very flexible build system, at least it appears so to
me. But the documentation is very poor for a newcomer. Specifically,
elaborate documentation is needed in the areas like Transformer, Rule (both
multiplex and non-multiplex), Module, etc.
2. Also documentation is needed on different JavaScript objects that are
accessible from QBS script like Command, JavaScriptCommand, File, etc.
3. Examples that are provided with QBS source code are not sufficient to
build up ideas on different QBS constructs.
4. It is not obvious from documentation how to create custom build jobs in
QBS. For example lets say in my project I have flex/bison files along with
other C files and I want to build those flex/bison files first with
respective tools before compiling all the C files. How to specify this
custom step?
5. Also lets assume that while building my C project I want to first check
if all my unit test cases pass. How to do that in QBS build script?

I would really like to see QBS grow as a very flexible and easily adaptable
build system for C/C++ projects. So I hope my inputs will be helpful in
this regard.

Thanks and regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20140503/2b2c417a/attachment.html>

More information about the Qbs mailing list