[QBS] How to set the Qt version from the command line?

Joerg Bornemann joerg.bornemann at nokia.com
Wed Mar 21 19:38:03 CET 2012

On 21/03/2012 15:21, ext devtomsci at me.com wrote:

> I can see from qtcore.qbs that everything hangs off qtcore.qtVersionName
> which is set from defaults/qtVersionName. However I can't see any way of
> overriding it.

The syntax for this is not easy to guess:
     qbs release platform:msvc2010 qt/core.qtVersionName:x64 

You have to specify the module in which the property is to be set.
So for C++ optimization you do
    qbs cpp.optimization:superFast

If you omit the module name, then the qbs base module 
(share/qbs/modules/qbs/common.qbs) is assumed:
    qbs foo:bar
is the same as
    qbs qbs.foo:bar

It happens that the base module also has the property architecture. 
That's why
    qbs architecture:x86_64

> but how to set qtVersionName escapes me. Is it simply that QBS-64 is
> getting in the way? Either way, what is (or should be) the correct
> command line syntax to do this? All the examples I can find just rely on
> qt/default/path being set.

This definitely must find its way into the docs! :)

> It would also be nice if qbs could figure out the appropriate platform
> and architecture from the qt version, since they have to match up
> anyway. (Although I understand if it's not as easy as it sounds to
> figure this out!)

Depends from which side you're looking at the problem. Does the chosen 
Qt select the platform (Qt Creator / qmake way) or does the chosen 
platform select the Qt build (which one)?

> ps an aliases feature by which I could say that x64 means
> "platform:msvc2010 qtVersionName:x64 architecture:x86_64" would be nice
> too :)

Heh another potential user for this feature. :)



More information about the Qbs mailing list