Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-03-07 04:08:57


Hi Kirill,

glad to see you back on this list!

> Anyways, here is my problem.
>
> On surface the problem is very simple. Suppose you pretty much want to
> use verbatim example out of a box. Suppose the project is a bit more
> complicated then everything-in-one-directory. Now if you have
>
> actions inline-file
> {
> "./inline_file.py" $(<) $(>)
> }
>
> it will fail miserably when you execute bjam from any folder other then
> the one where inline_file.py is located.
>
> I thought ok, fine I'll use path-constant!
>
> Problem -- I defined path-constant in Jamroot, but it is not visible in
> verbatim.jam.
>
> Fine, I'll hack my way for now and I moved all the code from
> verbatim.jam to Jamroot. That one sort of fixed the problem, except that
> build log looks a bit awkward (due to the fact that Jamroot's name
> consists of full path to the file), but that's a hack anyways, no big deal.
>
> First question: what is the proper fix for this problem?

I'd probably add 'init' rule to verbatim.jam and the have this in Jamroot:

   path-constant ROOT : . ;
   using verbatim : $(ROOT) ;

> Secondly, my use case is a bit different from verbatim example, in a
> sense that I generate an .hpp file from multiple sources. So my
> invocation is explicit:
>
> hpp generated.hpp : source1 source2 ;
> lib util : util.cpp ;
>
> Obviously util.cpp has #include "generated.hpp"
>
> Second question: will lib rule pick up dependency on generated.hpp and
> realize that it has to regenerate it (if needed) before compiling util.cpp?

No, you'd need:

    lib util : util.cpp : <implicit-dependency>generated.hpp ;

as documented at

http://boost.org/boost-build2/doc/html/bbv2/reference/jamfiles.html#bbv2.reference.headers

> Third question: the whole setup currently does not work, because
> generated.hpp gets created in build directory, but that said directory
> is not added to includes when compiling util.cpp. What is the right way
> to fix that?

Again, use <implicit-dependency>

- Volodya


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