| | 1 | We illustrate here a simple example of package dependency. |
| | 2 | We show how CMT deals with a package dependency between |
| | 3 | the package A and B. |
| | 4 | |
| | 5 | Let's consider a package A: |
| | 6 | |
| | 7 | {{{ |
| | 8 | > cmt create A V1 |
| | 9 | ... |
| | 10 | > cd A/v1/src |
| | 11 | ... |
| | 12 | > more A.h |
| | 13 | #include <iostream> |
| | 14 | |
| | 15 | using namespace std; |
| | 16 | |
| | 17 | class A |
| | 18 | { |
| | 19 | public: |
| | 20 | A() {} |
| | 21 | ~A() {} |
| | 22 | void print (); |
| | 23 | }; |
| | 24 | > more A.cxx |
| | 25 | #include "A.h" |
| | 26 | |
| | 27 | void A::print () |
| | 28 | { |
| | 29 | cout<<"A"<<endl; |
| | 30 | } |
| | 31 | }}} |
| | 32 | |
| | 33 | We have the following requirement file: |
| | 34 | {{{ |
| | 35 | > cd cmt |
| | 36 | > more requirements |
| | 37 | package A |
| | 38 | |
| | 39 | author Vincent Garonne <garonne@lal.in2p3.fr> |
| | 40 | |
| | 41 | library A A.cxx |
| | 42 | |
| | 43 | macro A_linkopts " -L$(AROOT)/$(A_tag) -lA " |
| | 44 | }}} |
| | 45 | |
| | 46 | The macro A_linkopts will be automaticaly inserted for the link operation. |
| | 47 | The library location is specified with $(AROOT)/$(A_tag). |
| | 48 | |