Boost logo

Boost-Build :

From: Tyson Marchuk (tmarchuk_at_[hidden])
Date: 2005-10-27 13:02:01


Hi Volodya,

Thank you very much. The change you suggested makes the build work the
way I want it to. The only remaining issue is of course the need to
generate a 'fake' CPP file so that BBv2 sees the H -> MOCCED_H -> CPP
-> OBJ chain and actually bothers making the MOC file.

In any case it's now usuable and I appreciate your help.

Thanks again,
-Tyson Marchuk

--- In jamboost_at_[hidden], Vladimir Prus <ghost_at_c...> wrote:
>
> Hi Tyson,
>
> > Is there an easy way to force boost to add the build directory to the
> > list of includes it uses for compiling for every file?
> .....
> > Basically at our company we have a lot of QT classes where instead of
> > generating a MOC file from the header and compiling it and then
> > linking it into the library or executable we generate the MOC file
> > from the header and then #include it in the implementation file.
> .....
> > So I changed the qt.jam file slightly to remove this line:
> > generators.register-standard qt.moc : H : CPP(moc_%) : <allow>qt ;
> >
> > And I added these lines in their place (MOCCED_CPP was added to the
> > qt.jam file in the types directory):
> > generators.register-standard qt.moc : H : MOCCED_CPP(%.moc.cxx) :
> > <allow>qt ;
> > generators.register-standard qt.fakeCpp : MOCCED_CPP : CPP(moc_%) :
> > <allow>qt ;
> >
> > I also added below the qt.moc action:
> > actions fakeCpp
> > {
> > genFakeCpp $(>) $(<)
> > }
> >
> > The change to (%.moc.cxx) from (moc_%) is necessary because in our
> > current build system that's how we name our MOC files. 'genFakeCpp' is
> > just a perl script that creates the expected (moc_%) CPP file with
> > just some trivial C++ code in it so that it gets compiled to an OBJ
> > and linked in by Boost.Build. (Technically I don't need this file but
> > if I don't provide Boost.Build with a path ending in an OBJ or a LIB
> > it won't generate the MOC file.)
>
> Well, *.moc.cxx are actually included? Then I'd suggest to rename
the type to
> MOCCED_H *and* declare it as:
>
> type MOCCED_H : moc.cxx : H ;
>
> that is derive the type from the "H" type. This should cause V2 to
magically
> add include paths to that file.
>
> You might sometimes need the <implicit-dependency> property:
>
> http://boost.org/boost-build2/doc/html/bbv2/reference/jamfiles.html
>
> but in most cases this should work fine. If you get this to work,
ping me and
> I'll tell (or even write), a code that does not require this "fakeCpp"
> action. The Qt4 support in CVS HEAD can automatically convert .ui
files into
> just .h (without any compilable .cpp files).
>
> - Volodya
>
> --
> Vladimir Prus
> http://vladimir_prus.blogspot.com
> Boost.Build V2: http://boost.org/boost-build2
>

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk