= How do i begin playing with CMT ? = by V.Garonne (05.4.2005) == Aim of this document == The purpose of this little document is to understand and use CMT with simple examples. == How to install CMT ? == See: * [http://www.cmtsite.org/install.html Install] == How to create a package ? == We do here the classic "Hello World" example with CMT. First we create the cmt package called "test" with version 1: {{{ > cmt create test v1 ------------------------------------------ Configuring environment for package test version v1. CMT version v1r18p20050501. Root set to /users/dsksi/garonne. System is Linux-i686 ------------------------------------------ Installing the package directory Installing the version directory Installing the cmt directory Installing the src directory Creating setup scripts. Creating cleanup scripts. > cd test/v1 > ls cmt src }}} We see here that a directory tree has been created. We now create and writte our small "C++" program (main.cxx, hello.h and hello.cxx).[[BR]] We have: {{{ > more src/hello.h ////////////////////////////////////////////////// // author: vincent garonne // // date: 4/5/2005 // // description: hello world description file // ////////////////////////////////////////////////// #ifndef __HELLO_WORLD__ #define __HELLO_WORLD__ class hello { public: // constructor hello () {} // desctructor ~hello (){} // function example void print (); }; #endif // __HELLO_WORLD__ > more src/hello.cxx ////////////////////////////////////////////////// // author: vincent garonne // // date: 4/5/2005 // // description: hello world body // ////////////////////////////////////////////////// using namespace std; #include #include "hello.h" void hello::print () { cout<<"Hello le world !!!"< more src/main.cxx ////////////////////////////////////////////////// // author: vincent garonne // // date: 4/5/2005 // // description: main program // ////////////////////////////////////////////////// #include "hello.h" int main () { hello object; object.print(); return 0; } }}} Then to construct the executable, we need to specify within the "requirements" file in the cmt directory : {{{ > cd cmt > more requirements package test application test hello.cxx main.cxx }}} Now we can compil and execute: {{{ > gmake > source setup.csh > test.exe Hello le world !!! }}}