= Implementing CMT2 on top of Waf == Principle: * Package stands below the project at arbitrary directory depth * Every package is packaged using the CMT style: * a `cmt` directory with its `requirements` file * the `requirements` files hold: * mention of used packages * declarations of the constituents (libraries, programs, user build modules...) * specific macro/set/path declarations * a `src` directory containing the sources * other optional directories * `` include files * job options * ... * The Project contains a `cmt` directory with its own `requirements` file * this `requirements` holds: * the list of packages belonging to the project * global definitions available to all packages * One install area per Project * default name is /installarea == Architecture Only one standard & generic `wscript` is needed for managing the whole project. It stands at the top level directory, i.e. above all other stuff of the project. {{{ import cmt top, out = cmt.init () def options (ctx): cmt.options (ctx) def configure (ctx): cmt.configure (ctx) def build (ctx): cmt.build (ctx) }}} The build is launched using: {{{ > waf.py configure build }}} and will output the binaries into one single build directory (currently the build directory has the name of the platform: win32 or linux2). None of the package contents are modified during the build. == Test configuration The setting on my windows machine is: {{{ set PATH=c:\Install\Python27;%PATH% set PATH=c:\Install\Waf;%PATH% set PYTHONPATH=c:\Arnault\CMT2\Waf;%PYTHONPATH% }}} and on lx2 {{{ source /lal/Python/2.5/sl4_amd64_gcc34/setup.csh setenv PYTHONPATH ~/CMT2/waf:$PYTHONPATH }}} The module `cmt.py` provides in addition a test generator mechanism able to generate a test configuration of N packages forming a tree of used packages. Each package is named `Pack` (n = 0 .. N-1) and implements: * one C++ (shared) library (name = `Lib`) * with one class (name `C`) defined in `Lib.hxx` and coded in `Lib.cxx` * the class instantiates one object of each used package as private members * the class provides one test function which recursively the test funtion of each used object. * one test program (name = `test`) * it instantiates one object of the `C` class * it calls the test function {{{ > cd test > python ../waf/cmt.py gencmt=50 or > python ../waf/cmt.py genwaf=50 }}} The generator generates the hierarchy of packages and may runs in two modes * the `waf` mode construct a native waf script at the top directory * the `cmt` mode installs a generic waf script which in turns calls the `cmt.py` module which interprets the hierarchy of requirements of generated packages. In both cases the build is launched using {{{ linux2> ( cd A ; ~/test/waf.py configure build linux2> }}} {{{ win32> cd A & ..\test\waf.py configure build & cd .. }}} == The current development is maintained using SVN: * [https://svn.lal.in2p3.fr/projects/CMT2/waf The SVN repository for the CMT module] == Next to do: * declare user build modules * eg: copy a file * gaudi component, etc... * multi-project using CMTPROJECTPATH * tag management for macro/set/path declaration * policy packages offering user build modules * automate initialisation of the work model * single work area: * a single package * a set of checked out packages part of a release * a complete project * using a set of pre-built projects