[Scons-users] Building in custom directory and relative paths to source files?

Pawel Tomulik ptomulik at meil.pw.edu.pl
Sat Apr 20 10:26:41 EDT 2013


Hi,

I've seen that several builders use commands such as:

'cd ${TARGET.dir} && $FOOCOM ${SOURCE.file} ${TARGET.file}'

This seems to put the restriction that SOURCE and TARGET both must lie
in same directory. If so, then is there something against using
'rel_path' for example?

'cd ${TARGET.dir} && $FOOCOM ${TARGET.rel_path(SOURCE)} ${TARGET.file}'

In theory it shouldn't alter existing projects (TARGET and SOURCE in
same directory). It could, however, enable different directories for
SOURCE and TARGET, and perhaps VariantDir (with duplicate=0) for some
tools which donot support them at the moment.

What do you think about it?

Another related question - is there any built in method to achieve
similar goal (relative paths) when lists are substituted (SOURCES,
TARGETS for example)? I think about something as:

'$FOCOM ${_concat("",SOURCES,"",__env__,RelTo(TARGET))}'

where 'RelTo' is the method of question?

Best regards!

--
Paweł Tomulik



More information about the Scons-users mailing list