[Scons-users] Getting directory in which Sconscript is running

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Thu May 1 11:48:00 EDT 2014


I'd really like to be able to get hold of the current SConscript directory relative to the SConstruct path, so with a directory structure in a repository a little like this:

+-SConstruct

|

+-A

|

+-B

|

+-SConscript

There will be something I can do in the SConscript that will get me "A/B" (i.e. the relative directory in which things will be built), and <wherever the source is>/A/B, which is the sort of thing I need to stuff in environment variable (for instance for getting the right PYTHONPATH for running python scripts which live in a subdirectory of B).

Using Dir('.').rstr() or .rdir() will get you '.'. Throwing srcdir().abspath into the mix will get me the full path to the build directory, not the full path to the source directory.

-------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140501/b09870b6/attachment.html


More information about the Scons-users mailing list