Subject: Re: [Boost-build] Problems passing absolute paths to conditional asfeature
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2009-07-16 05:12:04
[I keep having this bad habit of replying to myself, but perhaps someone
else can benefit of this as well.]
Johan Nilsson wrote:
> I'm working on a rule for using prebuilt libraries (not only boost
> libraries) and have hit upon something. I'm using features to pass
> the "base" name and the containing directory of the library to a
> which generates the needed "<file>" property.
> This seems to mostly work fine as long as I'm using relative paths
> for my feature, but when using an absolute path the feature
> "disappears" and is not passed along to the conditional rule. Please
> see attached Jamroot for a demo.
I've been doing some further investigation, and it seems like the
"absolute-/rootedness" itself of the path is not the culprit here. The
problem seems to be the colon (":") in the rooted path under Windows.
I've managed to workaround this by encoding the colons in paths before
passing them to the conditional (as values of my custom features). I can
then decode the path in the conditional and work out the exact path for the
dependency and then return e.g.
"<file>/C:/path/to/my/prebuilt-lib-with-tags" from the conditional.
Interestingly enough, it is no problem to return the absolute paths from the
conditional - that works just fine.
I'd say that this is probably a bug somewhere in the handling of indirect
> Another thing is that I need to declare the feature as "incidental"
> in order to have it passed, even when using relative paths. Why is this?
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