[Scons-users] Correct way to expand path variables
Henry Gomersall
heng at cantab.net
Mon Oct 14 12:10:41 EDT 2013
On 14/10/13 15:35, Gary Oberbrunner wrote:
> Hi Henry; use env.subst(str, target, source). You may also need to
> call env.str2nodes.
That doesn't seem to do as expected, though I'm not quite sure whether
I'm missing something:
In src/SConscript:
env.AppendUnique(JINJA_TEMPLATE_SEARCHPATH=['#foo', 'bar'])
in the scanner function:
print env.subst(env['JINJA_TEMPLATE_SEARCHPATH'])
outputs:
['#foo', 'bar']
rather than
['foo', 'src/bar']
The following outputs the same:
print [env.subst(each) for each in env['JINJA_TEMPLATE_SEARCHPATH']]
I get more success with env.Dir(env['JINJA_TEMPLATE_SEARCHPATH']); this
does expand '#foo' to 'foo' but doesn't seem to prepend the src
directory (and by extension, nor the variant dirs).
Cheers,
Henry
More information about the Scons-users
mailing list