[Scons-users] Executing a command, but with a set of sources that is determined by the build.

Ted Middleton tmiddleton at teradici.com
Tue Sep 11 04:41:07 EDT 2012


I have a build that generates a bunch of executables and shared libraries in a build directory. The number and names of these products changes fairly frequently, so I like to keep all of the details about them close to where they're built (like where Program() and SharedLibrary() are called).

At the end of the build I have this build/ directory with the products in it, but I'd like to copy all of the built files into another directory. I'd like to avoid copying all of them unconditionally. I've tried this:

prog76 = env.Program( 'prog76', sources = srcs )
install76 = env.Install( get_build_directory(), prog76 )
env.Alias( "build", install76 )



many more executables and shared libraries



stage = env.Install( get_staging_directory(), Glob( os.path.join( get_build_directory() , "*" ) ) )
env.Alias( 'stage', stage )
env.Depends( 'stage', 'build' )


Unfortunately I think that the env.Glob() doesn't take place in dependency-time - it doesn't seem to consistently get all the build products that land in the build directory. Can anyone tell me a good way of doing this?



More information about the Scons-users mailing list