Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2006-06-29 10:54:57


Chris Weed wrote:
> Hi,
> I currently can do the following:
>
> obj object1 : src/file1.cpp ;
> obj object2 : src/file2.cpp ;
> obj object3 : src/file3.cpp ;
> alias objects : object1 object2 object3 ;
>
> I would like the same thing, but glob all of the files in the src
> directory w/o enumerating all of them.
> I would like something like this:
> obj all_objs : [ glob src/*.cpp ] ;
>
> However, the obj rule seems to only take one source file and create
> one object file.
> I don't see how I can generate multiple object files from a glob command.
> Chris
>
How about this?

local srcs = [ glob ../adsizer/*.cpp ] ;
for local s in $(srcs) {
    obj $(s:B) : $(s) ;
}
alias objects : $(srcs:B) ;

Phillip


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