Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-03-20 02:04:37


On Saturday 18 March 2006 20:54, Rene Rivera wrote:
> Noel Belcourt wrote:
> > Hi,
> >
> > We've got a couple of source directories that we depend on but cannot
> > otherwise modify. Our problem is that there are ~500 source files in
> > this directory and I want to glob all the files but one. Is there some
> > notation to allow me to exclude one or more files from a glob? I'd
> > really hate to have to enumerate each source file in the Jamfile.
>
> Assuming BBv2 for this example... Something like this should work:
>
> import set ;
> import path ;
>
> local files =
> [ set.difference
> [ path.glob /path/ : *.cpp ] : [ path.glob /path/ : special.cpp ]
> ] ;

If this happen in Jamfile, things can be even simpler:

  import set ;

  local files =
    [ set.difference
     [ glob /path/*.cpp ] : /path/special.cpp ] ;

I.e.
  - using 'glob' not 'path.glob' can be more convenient
  - if there's one file to exclude, no need to glob for it, just name it

- 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