Boost logo

Boost-Build :

Subject: Re: [Boost-build] namespaces
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-10-14 14:25:09


AMDG

On 10/14/2016 12:07 PM, Stefan Seefeld wrote:
> And a little follow-up question:
>
> On 14.10.2016 13:33, Stefan Seefeld wrote:
>> Hi,
>>
>>
>> I have "import common ;" in my Jamfile. Later, I write an action as
>>
>> actions sphinx
>> {
>> common.copy $(something) : $(something-else) ;
>> }
>
> ...seems I can (magically) solve this by defining:
>
> cp = [ common.copy-command ] ;
> actions sphinx
> {
> $(cp) ... ;
> }
>
> though I don't quite understand why this is working, or what that is
> conceptually doing.

  common.copy-command returns the shell command
for copying files. An action block is run
by the shell (/bin/sh or cmd.exe by default).
The reason that this works, while your previous
attempt didn't is that the only variable substitution
happens in the body of an action block. Rules
are not called.

> My follow-up question: The `common` module defines the above
> 'copy-command', but that only copies files, not directories. How can I
> copy an entire directory ? (Please don't tell me to glob() the directory
> and then copy each file in that list individually. There must be a
> simpler way than that !)
>

You will need to glob all the files to copy.
(You can use glob-tree if you want it recursive.)
However, the install rule can copy many files
at once.

import path ;
path-constant here : . ;
sources = [ path.glob-tree $(here)/subdir : * ] ;
install files : $(sources) :
  <install-source-root>$(here)/subdir
  <location>install-dir ;

In Christ,
Steven Watanabe


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