Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-08-04 01:24:10


On Thursday 04 August 2005 06:07, slabman_meathouse wrote:

> Now onto my BBv2 migration...
>
> My first attempt was to create a Jamfile per project, containing a lib
> target archiving each category's class cpp file.
>
> Each category also contains a Jamfile. This Jamfile contains a test
> target, which included every cpp in the category (test_runner,
> test_foo, foo) as well as requiring the project to which it belonged.
>
> Does this sound sensible so far?
>
> I am hoping that there is a way to ensure that the project will build
> all of its categories without needing to be updated each time I create
> a new category in that project.
>
> If it were a flat directory structure, I realise it would be as simple
> as putting a type of glob *.cpp (excluding test_* somehow) in the
> project Jamfile. But I would rather not sacrifice the directory
> structuring.

How about putting this to your Jamfile:

project your_project ;
local components = [ glob */Jamfile ] ;

local libraries ;
for local c in $(components)
{
local name = $(c:D=) ;
local dir = $(c:D) ;
libraries += $(dir)//$(name) ;
}

exe your_project : main.cpp $(libraries) ;

This assumes that name of a lib target in each subdirectory is the same as
name of subdirectory.

HTH,
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