Boost logo

Boost-Build :

Subject: [Boost-build] bjam install rule to install a directory hierarchy
From: Mark E. Hamilton (mhamilt_at_[hidden])
Date: 2011-07-07 19:19:56


Hi,

I am using:

Boost.Build V2 (Milestone 12)
Boost.Jam 03.1.17

I'm trying to write a bjam install rule to install a directory hierarchy
into the destination. I first tried:

install install-test : $(source-root)/blarg.dir :
<location>$(install-root) ;

but that fails with this error:

error: Unable to find file or target named
error: '/scratch/mhamilt/projects/head/blarg.dir'
error: referred from project at
error: '/scratch/mhamilt/projects/head/Nbtools/Sierra'

presumably because the install rule only copies files to a single
location. Next I tried:

install install-test : [ path.glob-tree $(source-root)/blarg.dir : * ]
: <location>$(install-root) <install-source-root>$(source-root) ;

which failed with this:

error: Unable to find file or target named
error: '/scratch/mhamilt/projects/head/blarg.dir/something'
error: referred from project at
error: '/scratch/mhamilt/projects/head/Nbtools/Sierra'

presumably because the glob-tree returns directories as well as files.

I looked at package.install, but it wasn't clear to me that it would do
what I want (and it calls stage.install anyway, which I think is what
the install rule uses.)

Someone suggested using :

v = [ SHELL "cp -r $(source-root)/blarg $(install-root)" : exit-status ] ;

in the Jamroot file which works, but is really ugly and can't be invoked
by itself because it's not in a target rule.

If there was a rule that would return only files in a tree, or if
glob-tree could exclude directories, that might work in my second
example above. It's not obvious to me how to put the SHELL command into
a simple target rule, but perhaps that would also do what I want.

What's the best way to do what I need?

-- 
----------------
Mark E. Hamilton
GAITS, Inc.
Sandia National Laboratory, NM.
505-844-7666

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