[Scons-users] issue with variant-dir

William Blevins wblevins001 at gmail.com
Thu Aug 4 18:53:59 EDT 2016


Stefan,

Can you specific the images files themselves rather than just the
directory? Perhaps with Glob?

V/R,
William

On Thu, Aug 4, 2016 at 10:55 PM, Stefan Seefeld <stefan at seefeld.name> wrote:

> Hi,
>
> I'm having some issue with the variant_dir variable. I have reduced the
> problem to a minimal test case, so let me illustrate the problem with that:
>
>
> Consider the following directory structure:
>
>
> ./SConstruct
>
> ./src/SConscript
>
>         index.html
>
>         style.css
>
>         images/
>
>
> ./build/
>
> ./html/
>
>
> The toplevel SConstruct file contains "env.SConscript('src/SConscript',
> variant_dir='build', exports={'env':env})",
>
> and the src/SConscript file contains this chunk of code:
>
>
>   Import('env')
>
>   def MakeHTML(target, source, resources=[]):
>
>       env.Command(target, source,
>                 [Mkdir('$TARGET'),
>                  Copy('$TARGET/', '$SOURCE')])
>       for r in resources:
>           env.Depends(target, target + r)
>           env.Command(target + r, r, Copy('$TARGET', '$SOURCE'))
>
>
>   MakeHTML('html/', 'index.html', resources=['style.css', 'images/'])
>
>
> The intent is simply to copy "index.html" and its dependencies
> ("style.css" and "images/") from src/ into html/, using "./build" as a
> temporary build directory. SCons will start by creating "build/" and
> clone "index.html" and "style.css" into it together with the
> "SConscript" file. For some reason it does not clone the "images/"
> directory. This causes the actual build command (here just a simple
> copy) to fail with
>
>   "scons: *** [build/html/images] build/images: No such file or directory"
>
> Note that everything works fine if I don't use a variant directory.
>
>
> Does anyone know what I'm doing wrong ? (I don't want to list the
> individual files in "images/" explicitly in my SConscript file.)
>
>
> Thanks,
>
>         Stefan
>
> --
>
>       ...ich hab' noch einen Koffer in Berlin...
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160804/51a9a52c/attachment-0001.html>


More information about the Scons-users mailing list