wtools
ESOwaftools
 All Classes Namespaces Functions Pages
Examples

Basic project

Consider this project layout with a single module fooBar within the package baz.

    .                       
    |-- baz                 # package baz
    |   |-- fooBar          # module fooBar
    |   |   |-- src         # source directory for fooBar
    |   |   `-- wscript     # module wscript
    |   `-- wscript         # package wscript
    |-- wtools              # wtools waf-extensions
    `-- wscript             # top level wscript (Project)

In this example wscript we declare a package by giving it a name, version and where to recurse into. The recurse pattern supports basic globbing, c.f. recurse.

1 # ./wscript
2 from wtools import project
3 
4 def configure(cnf):
5  # External dependencies are configured here
6  pass
7 
8 project.declare_project(name='example',
9  version='1.0-dev',
10  requires='cxx', # required features the project needs
11  recurse='foo')

The baz package wscript is even simpler:

1 # ./baz/wscript
2 from wtools import package
3 
4 package.declare_package(recurse='*')

In simple use cases the fooBar-module wscript simply contains information of which type of module it is. In this example it is a C/C++ program.

1 # ./baz/fooBar/wscript
2 from wtools import module
3 
4 module.declare_cprogram()