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

Joerg Bornemann joerg.bornemann at digia.com
Mon May 5 11:26:04 CEST 2014

On 03-May-14 22:40, Jake Petroules wrote:

>> 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"?
> We did this so that having multiple files with the same base name but
> different extensions will not cause an error. For example, if you have
> both file.c and file.cpp, both cannot be built into file.o as this
> causes a conflict. Currently you cannot change the naming scheme of
> object files but given a good reason we may add a way for users to
> configure it. Is there a specific reason you need your object files
> named XXXXX.o?

Also, we're considering the build directory to be opaque for the user. 
The directory layout and naming conventions of files should not matter.

I have the same question like Jake. What's your use case?

>> 3. Moreover the object files are getting generated in a folder ".obj"
>> in the default build directory. How to configure this also?
> This is currently not user-configurable but probably should be.

Probably. But here as well: what's the use case?

>> 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.
> Qbs is a very new product so we still have a lot of work to do in this
> area but it's definitely on the roadmap.

That's unfortunately true. Please ask on this mailing list, if 
something's unclear. We'll try to extend the docs in those areas.

>> 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?
> You'd do this using custom Rules, Transformers, and Modules. I remember
> another user had written some Qbs scripts to handle flex/bison files;
> perhaps we can add built-in support at some point. Again, this is
> something that more extensive documentation could help with as you noted
> in (1).

There's an example in tests/auto/blackbox/testdata/codegen and another 
in tests/auto/blackbox/testdata/dynamicRuleOutputs.
We should move them over to the examples directory.



More information about the Qbs mailing list