[QBS] Just a few questions

Kevin Chaves kmchaves at live.com
Mon May 26 19:10:24 CEST 2014


I just got started a few days ago with qbs hoping to replace our atrocity qmake setup. We ran into a lot of odd situations with qmake because we generate qmake cache on the first build to import the top level directory of our build. We did this so we could pass variables to all of the projects without using the relative path all over the place.

I thought I read something about qbs being able to use inheritance but I’m not sure if this is true. And I’m a little confused over the difference between Project { references: } and Project { SubProject {} }. I’m trying to define some global cxx flags and it doesn’t appear there is an easy way to do this.

I tried using function commonCxxFlags {} at the top level directory but that didn't seem to be inherited by the subprojects. 



  function commonCxxFlags{

    var flags = “-std=c++0x”

    return flags


  SubProject {

    filePath: “HelloLib/HelloLib.qbs”


  SubProject {

    filePath: “HelloApp/HelloApp.qbs”




StaticLibrary {

  name: “HelloLib”

  files: [“*.cpp”,  “*.h”]

  Depends { name: “cpp” }

  cpp.cxxFlags = commonCxxFlags


It looks like I might be able to do something like this in 1.3 where sourceDirectory can be used with… moduleSearchPath I think it was. Also is it possible to get the qmake and gcc being used to build a .pro project? We use external libraries as part of the build and they only support .pro for now. Converting them to qbs probably won’t be too difficult but if i don’t have to that would be nice. 

Sent from Windows Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20140526/3c1e823e/attachment.html>

More information about the Qbs mailing list