Boost logo

Boost-Build :

From: Mike Glazer (mglazer_at_[hidden])
Date: 2005-05-19 11:23:20


I'm trying to get the Moc generator to automatically add its output
directory to the list of compiler includes.

Essentially I have a Jam file that looks like this:

# Jam file begin
project somelibrary
: build-dir $(BUILDDIR)

lib libname
: [ glob *.cxx ]
: <include>.
: : <include>.

#Jam file end

The two .h files are in there because they are QObjects and need to be
compiled by the Moc compiler. The output is a .moc.cxx file (I modified
the qt.jam file so that instead of CPP(moc_%) it says CPP(%.moc)) that
is included by the appropriate QObjectHeader cxx file. The problem is
that the .moc.cxx files are generated fine, but they build directory is
not added to the list of gcc compiler includes.

If I do this:

lib libname
: [ glob *.cxx ]
: <include>.
: : <include>.

In my Jamfile and just 'touch' the 'Temp.ui' file it works fine (ie: the
build directory is added to the list of compiler includes) but it fails
when uic tries to compile the Temp.ui file.

So my question is:

Is there any way to fix this so that QObject header file -> moc.cxx
generation works the way I want it to? If not, is there some way to
determine the build directory being used such that I can add it to the
list of includes (can I modify the list of includes inside of a rule?) ?

Also, has anyone written a scanner that automatically looks in header
files for the Q_OBJECT line, and if it is then that file is
automatically added to this list of sources?

I'm still really new with Boost.Build and I've tried reading through all
of the .jam source files, but a lot of them are really complex for a


Mike Glazer


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at