[build2] Adding support for Qt

Boris Kolpackov boris at codesynthesis.com
Tue Jan 9 14:27:41 UTC 2018


Philippe Payant <philtherobot at gmail.com> writes:

> Correct me if I am wrong on my following understanding.  Qt would be a
> package, downloaded and unpacked (as sources), then build2, as part of its
> Qt module, would compile moc, ui and lupdate (at least those) according to
> the host configuration, then compile Qt according to target configuration.
> User's code would be mocced and uied with the built tools and everything
> linked normally at the end.
> 
> Or no, maybe you mean that any package can declare "I have a build tool"
> (Qt would say "I have moc" and others).  build2 can then compile and
> leverage those packaged tools as a new "transformation" that was injected
> in the toolchain from a package.

It's kind of both.

There will be the libqt-XXX packages as well as, say, qtmoc package, etc.
The qtmoc, besides the source code for the moc compiler itself, will
include the build2 build system module which is basically the build
system rule for compiling moc files.

A user project/package that uses Qt will have *build-time* dependency
on qtmoc and *run-time* dependency on libqt-XXX (see depends[1]). And,
yes, you are correct, build-time dependencies will be built for host
and run-time for target (this handling of build-time dependencies is
still a TODO in bpkg). Also, when the user buildfile tries to load
the qtmoc module (in order to compile things with the moc compiler),
build2 will automatically build (on the side) the qtmoc module from
source and load it into the build system process (this is also still
a TODO).


> My wishes are to participate in some way in the "C++ needs a package and
> build system" movement and to enable a great build system at my workplace,
> which relies on Qt.

Sounds like you came to the right place ;-)

[1] https://build2.org/bpkg/doc/build2-package-manager-manual.xhtml#manifest-package-depends

Boris



More information about the users mailing list