[Scons-users] SCon example for common build scenario

ronex chako ronex_89 at yahoo.in
Mon Jun 16 15:12:13 EDT 2014


Hi,





On Monday, 16 June 2014 11:59 PM, ronex chako <ronex_89 at yahoo.in> wrote:
 


Hi Dan,

Thanks for  sharing wondeful example and explaining my queries in detail, Kindly help me with few more questions as mentioned below:

1) How to copy contents of include directory of each module into another directory('headers_dir').
    How could I do this using scons ?
    I check copy function and tried to use it as follow:
      Default(Copy('module_1/include', 'headers_dir/module_1/include')) -- But this wasn't working
   Here I have used Default because this should be done as default.
   This can be done using subprocess, Please suggest how could I do the same ?

>>>>> It is working with Install function, why Copy method doesn't work there ?
2) Is it possible to call SConstruct file from another SConscript file ?
    I need to
 do this because suppose dir_1 is a general directory with SConscript which creates  a libarary libdir_.
    Another dir_2 , also contains SConstruct and SConscript file, If dir_2 build satndalone and it also need to use libdir_1, How this can be done. Directly calling SConscript of dir_1 might create problem like,
in dir_1/src/SConscript:
    src_list = Globe(os.path.join(Dir('#').abspath, 'src', '*.cpp'))
    inc_list = Globe(os.path.join(Dir('#').abspath, 'inc', '*.h'))

3) In Scon how source build can be made dependent on each header included in the source file(except system header files)  ?
   how could it be implemnted for src_list['a.cpp', 'b.cpp', 'c.cpp'] and inc_list['a.h', 'b.h', 'c.h'] ?
   I am
 looking for the similar approach as in makefile, i.e. generating dependency files which can be read first before creating objects.


Thanks once again for help :-)


On Monday, 16 June 2014 9:43 PM, Dan Pidcock <dan.pidcock at googlemail.com> wrote:
 


Hi Dirk,

Yes you're absolutely correct. Don't know how I got os.getcwd() into CPPPATH, must be an old test project!
For LIBPATH, my thinking is that the output directory should generally not be in the same dir as source code, but for portability of this sample project I have left it as cwd. I think in a real world project you would set it from an environment variable (with sensible O/S specific defaults) or something like that. I did try just to set it to '.', but couldn't get that working with SCons.

Thanks for the points, I've updated the project.

Dan



On 16 June 2014 16:56, Dirk Bächle <tshortik at gmx.de> wrote:

Hi Dan,
 
thanks for the nice example. I had a short look at it, and I think that it's a good start. Allow me one small remark though: I'm not a big fan of using absolute paths for specifying LIBPATH and CPPPATH, in connection with VariantDirs. By using relative paths like "../module1" you don't have to pass the current "build" dir down to your modules, and are much more flexible and robust against changes in the directory structure of your "src" tree.
>
>Just my 2 cents.
>
>Best regards,
>
>Dirk
>
>
>_______________________________________________
>Scons-users mailing list
>Scons-users at scons.org
>http://four.pairlist.net/mailman/listinfo/scons-users
>
>


_______________________________________________
Scons-users mailing list
Scons-users at scons.org
http://four.pairlist.net/mailman/listinfo/scons-users




_______________________________________________
Scons-users mailing list
Scons-users at scons.org
http://four.pairlist.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140617/6bf446e8/attachment.html>


More information about the Scons-users mailing list