[QBS] how to use qbs in huge projects

Kurt Keller kk at parity-software.com
Wed Oct 8 17:08:39 CEST 2014


My projects are structured in sub directories: starting from a base
directory
there are subdirectories for binaries (debug and release, libraries (.so,
.dll) and 
.lib and .pdb files) as well as a subdirectory structure for application
and library
source code. There are sometimes more than 4 levels of directories and
around
50+ sub projects (libraries, tools, applications etc).

I understand the concept, that there should be one qbs file in the project
base 
directory, which defines properties and references the qbs files in
subdirectories 
which in turn inherit these properties and so on.

By implementing a qbs hierarchy like this, I encounter the following
problems:
  - qtcreator needs ages to load the qbs file in the base directory (50+
sub-qbs files)
  - once qtcreator has parsed the complete qbs hierarchy, I could not find a
way
    to compile & debug a subproject only. (i.e. "set as active project" is
not available)
  - it is not possible, to open subprojects directly with qt creator:
          qtcreator subproject/subsubproject/subsubproject.qbs
    there always will be some properties missing.
  - in addition I want to be able, to do: 'cd subproject/subsubproject; qbs'
in a cmd 
    window which is not possible, because subsubproject does not know the
properties
    of higher level projects.

So I created modules, to store 'global properties'. My sub{sub+}projects
depend on
this modules and know therefore the 'global' properties. But as soon as
relative
pathnames (upward paths, like '../../../include' or '../../lib/Debug') are
used, this
practice does not work very well. ('cd subdir; qbs' will not work (cannot
find include files)
while 'cd subdir/subdir/subdir; qbs' will find the include files or vice
versa)
Switching to absolute path names is a problem too, because there is a base
dir for 
every release of the project. (project-5.0, project-5.1, ...) So I have to
change all 
absolute path names when starting a new release...

How do other qbs users deal with this problem? Always qbssing from the top
level 
(base) directory? And what about qt creator usage? 
Is it possible, to keep the build directories down in the
sub{sub+}directories, while 
qbssing from the top directory?

Best regards
Kurt.






More information about the Qbs mailing list