Boost logo

Boost-Build :

Subject: Re: [Boost-build] namespaces
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2016-10-14 14:35:01


On 14.10.2016 14:25, Steven Watanabe wrote:
> 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.

OK
>> 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 ;

OK, but I'm not quite installing yet. I'm implementing the workflow of
the build itself. And since the Boost conventions involve putting the
intermediate files into bin.v2/, while putting the final document files
(html etc.) into the source tree, I'm trying to copy the full numpy
documentation source tree into the build directory, call 'make' there,
then copy the generated html tree back into the source tree.
See
https://github.com/stefanseefeld/boost.python/blob/numpy/doc/Jamfile#L30
for a quick hack that works on my Linux laptop.
As noted there, I need to rewrite that so it works everywhere, and would
very much appreciate any help I could get.

Thanks !

        Stefan

PS: This is one of the places where Boost would benefit from more
modularity: Why can't each project define its own build logic, so the
Boost umbrella project then only needs to dispatch to those. This would
avoid me having to maintain two distinct build systems, and would allow
you (and Rene, in particular) not having to care about any build details
(such as prerequisites) of module build systems.

-- 
      ...ich hab' noch einen Koffer in Berlin...

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