tags:

views:

187

answers:

1

I'm doing:

data = env.InstallAs('$PREFIX/share/odysi', 'data')
env.Alias('install', data)

Which works fine the first time. But if I change something inside the 'data' folder and do scons -Q install again, it says `install' is up to date. even though a file has changed and needs to be reinstalled.

There are a lot of files in the directory (and sub directories) so if I can avoid explicitly listing them, that would be best. Tips?

+1  A: 

This should do the trick:

files = Glob('data/*.*')
data = env.Install('$PREFIX/share/odysi', files)
env.Alias('install', data)

It needs at least SCons 1.0.1 for Glob support.

rq
Is it possible to do the same thing, but to recursively include sub-directories and their files as well?
Sydius
No. You would have to do a Glob-per-directory.
rq
What if the sub-directories are dynamic and can't be known until the install step?
Sydius
That's a pretty complex use case. Glob knows about generated Nodes so should do the right thing, but you'd probably have to write code to create dynamic Glob()s.
rq