Pavel
Pavel

Reputation: 5662

Multiple locations within a folder hierarchy to run SCons from

So far, I've only seen examples of running SCons in the same folder as the single SConstruct file resides. Let's say my project structure is like:

What I'd like is to be able to run 'scons' at the root and also inside tools/mytool. The latter compiles only mytool. Is this possible with SCons?

I assume it involves creating another SConstruct file. I've made another one: tools/mytool/SConstruct

I made it contain only:

SConscript('../../SConstruct')

and I was thinking of doing Import('env mytoolTarget') and calling Default(mytoolTarget), but running it with just the above runs in the current directory instead of from the root, so the include paths are broken.

What's the correct way to do this?

Upvotes: 1

Views: 280

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 992707

You can use the -u option to do this. From any subdirectory, scons -u will search upwards in the directory tree for an SConstruct file.

Upvotes: 2

Related Questions