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

devtomsci at me.com devtomsci at me.com
Wed Mar 21 15:21:31 CET 2012

Hi all,

I'm trying to handle building both 64-bit and 32-bit binaries from a single invocation of qbs, and I'm having trouble finding any way of overriding the default Qt libraries path coming from qt/default/path. (For unimportant reasons I build 64-bit with msvc2010 and 32-bit with mingw)

This is what I have setup:
>qbs config --global --list
global variables:
defaults/platform = mingw32
qt/default/path = D:\QtSDK-1.1\Desktop\Qt\4.7.2\mingw
qt/x64/path = D:\QtSDK-1.1\QtSources\4.7.2-msvc2010-x64

>qbs platforms list
        - msvc2010
        - MSVC2008
        - mingw32 (default)

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. I'd like to do something like:

qbs release platform:msvc2010 qtVersionName:x64 architecture:x86_64 release platform:mingw32 architecture:x86

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.

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!)



ps an aliases feature by which I could say that x64 means "platform:msvc2010 qtVersionName:x64 architecture:x86_64" would be nice too :) 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20120321/b68f9b36/attachment.html>

More information about the Qbs mailing list