There are 3 ways to specify a SConstruct file when using SCons, as shown below:
Run scons from the root of the project where the SConstruct file should be. This is the most standard way.
From the project subdirectory where the SConsctruct file should be in the root, execute scons using one of the following options (as seen by scons -h) to tell her to find the directory structure for SConstruct
-u, --up, --search-up Search up directory tree for SConstruct, build targets at or below current directory. -U Search up directory tree for SConstruct, build Default() targets from local SConscript.
- Explicitly indicate where the SConstruct file is located, this is also available from
scons -h
-f FILE,
Here is an example project in the directory /home/notroot/projectDir with the following directory structure:
SConstruct subdir/file.hh subdir/file.cc
Here's how to use the various options mentioned above:
Option 1:
Run scons from the project root directory
# cd /home/notroot/projectDir
Option 2:
Run scon from the project directory and tell it to view the dir hierarchy for SConstruct
# cd /home/notroot/projectDir/subdir
Option 3:
Run scons from the project directory and specify the path to SConstruct
# cd /home/notroot/projectDir/subdir
source share