[Scons-users] Correct way to expand path variables

Henry Gomersall heng at cantab.net
Fri Oct 18 13:11:18 EDT 2013


On 18/10/13 17:02, Dirk Bächle wrote:

> On 18.10.2013 16:06, Henry Gomersall wrote:

>> On 14/10/13 18:03, Dirk Bächle wrote:

>>> [...]

>>>>

>>>

>>> please try

>>>

>>> print env.subst('$JINJA_TEMPLATE_SEARCHPATH')

>>>

>>> instead. Additionally, you might want to have a short look at

>>> "7.2.3. Expanding Values From a Construction Environment: the subst

>>> Method" in the UserGuide...

>>

>> Apologies for the slowness on this, I've been rather busy on other

>> things.

>>

>> It makes more sense now. I assumed that it was automatically in the

>> same way that CPPPATH is. Is there a way to do more automated

>> handling so not requiring the user to instantiate the nodes explicitly?

>>

>

> I'm not quite sure about what you mean here by "more automated

> handling". The substitution of JINJA_TEMPLATE_SEARCHPATH takes place

> in the scanner, right? So it's part of the Tool, and the normal user

> shouldn't have to worry about these steps at all.

>

> Can you give a short example (like in a code snippet) where you point

> to an expression and say: "I want to get rid of this, and have it look

> more like this."?


So I originally wrote a whole spiel about how I wanted it handled
because I assumed that CPPPATH is handled differently. It seems it is
not and so I should stop worrying! I suppose I thought that strings
defined in a SConscript file should somehow be prepended with the
directory containing the SConscript file when Dir called on that string.

Cheers,
Henry


More information about the Scons-users mailing list