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

William Deegan bill at baddogconsulting.com
Tue Sep 11 14:41:17 EDT 2012


Ted,

On Sep 11, 2012, at 1:41 AM, Ted Middleton <tmiddleton at teradici.com> wrote:


> 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?


For your prog,install,alias sections any reason you don't just build the programs (etc) into the get_build_directory() location directly?

install_list=[]

install_list.extend(install76)

then
stage = env.Install(get_staging_directory(),install_list)

Might be the simplest way to do so.

-Bill


More information about the Scons-users mailing list