[Scons-users] Out of project tree builds
H. S. Teoh
hsteoh at quickfur.ath.cx
Mon Oct 29 21:57:10 EDT 2012
On Mon, Oct 29, 2012 at 09:40:45PM -0400, Francis Bolduc wrote:
> > I personally don't find much need for this sort of thing (and prefer
> > the fact that SCons makes building multiple variants easier), but I
> > can imagine that some people would.
>
> So do I, but things become tricky if you use the Install() builder.
>
> It makes sense to allow the user to specify the target installation
> directory on the command line with AddOption().
>
> But if the target directory is not under SConstruct, files will not be
> copied... or at least that was my experience. Maybe I'm missing
> something.
[...]
I work around that by using an Alias target:
installdir = '/opt/usr'
env.Alias('install', installdir)
Then run 'scons install'. Perhaps a Default target might work too?
In any case, this has the interesting behaviour that only targets that
actually end up in installdir will be built, which is usually not a
problem unless you were expecting everything to be built. But I usually
build in-tree first, then install elsewhere, so this works relatively
well for me.
T
--
Тише едешь, дальше будешь.
More information about the Scons-users
mailing list