Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-07-28 00:00:04


On Thursday 28 July 2005 01:31, JF wrote:
> Is there a way to get a substring in a Jamfile
>
> I noticed there is $(<:S) and $(<:B) to get different parts of a file
> but I've got some weird files, for example a source file is named
> S383.PRO and the compiled version is C383.PRO the number and extension
> stays the same but the first letter changes from S -> C any ideas?

You can use the MATCH builtin to extract the part of the string you're
interested it, and then add whatever you want. Say (untested code):

local m = [ MATCH S([0-9]*).PRO ] ;
local new-name = C$(m[1]).PRO ;

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