I need to run two programs sequentially as part of a custom builder.
One of them is a program in which I am stuck and cannot deal with absolute / relative paths, so I need to use the chdir=1 option for Builder so that its actions are executed in the same directory as the target.
The second is the script, which is located in the tools subdirectory of the project; The SConstruct file is at the root of the project. I need to create an action to run this script, and I am having problems because I have neither an absolute path to the project, nor a relative path from the directory where the target is back to the tools subdirectory where the script is located. If I could somehow get the absolute path to the root directory of my project, I would be configured, I could just concatenate `tools / myscript.bar 'and do it.
Here is what I have, more or less:
env['BUILDERS']['FooBar'] = Builder(action = [ 'c:/bin/foo.exe ${SOURCE.filebase}', 'c:/bin/bar-interpreter.exe myscript.bar ${SOURCE.filebase}', ], chdir=1);
The problem is that I need to change the action in question so that I can find "myscript.bar", something like:
env['BUILDERS']['FooBar'] = Builder(action = [ 'c:/bin/foo.exe ${SOURCE.filebase}', 'c:/bin/bar-interpreter.exe $PATHTOHERE/tools/myscript.bar ${SOURCE.filebase}', ], chdir=1);
It seems so simple, but I can't figure out how to do it.
scons
Jason s
source share