I set the CPPPATH variable via ParseFlags:
env = Environment()
env["CXX"] = "clang++"
d = env.ParseFlags("-I. -I../utl")
print d
env.StaticLibrary(target="myLib",source = source_files)
The print of d shows CPPPATH set to the correct directory:
{'CPPFLAGS': [], 'FRAMEWORKPATH': [], 'LIBPATH': [], 'CXXFLAGS': [], 'LIBS': [], 'ASFLAGS': [], 'LINKFLAGS': [], 'RPATH': [], 'CPPDEFINES': [], 'FRAMEWORKS': [], 'CCFLAGS': [], 'CFLAGS': [], 'CPPPATH': ['.', '../utl']}
However, the compile output has no -I option:
clang++ -o ABC_Exception.o -c ABC_Exception.cpp
And fails to find an include file in ../utl
./ABC_Exception.hpp:4:10: fatal error: 'Exception.hpp' file not found
ParseFlags should be followed by MergeFlags to add the variables to the environment as described in the SCons documentation.
ParseFlags returns a dictionary containing the options distributed into their respective construction variables. Normally, this dictionary would be passed to MergeFlags to merge the options into a construction environment, but the dictionary can be edited if desired to provide additional functionality. (Note that if the flags are not going to be edited, calling MergeFlags with the options directly will avoid an additional step.)
In your example, you can simply call MergeFlags with the string passed to ParseFlags.