| 1 | = LEMON Contrib Template = |
| 2 | |
| 3 | The aim of [http://lemon.cs.elte.hu/hg/lemon-contrib-template the template repository] is to make is easier to setup a new LEMON based project. |
| 4 | It provides a cross platform [CMake http://cmake.org/] build environment. |
| 5 | |
| 6 | This guide assumes you use Linux or some other UN*X based system, but everything works equally well on Windows, too. |
| 7 | |
| 8 | == Setup and Build the Template == |
| 9 | |
| 10 | This is fairly easy. First, clone the contrib template repository and step |
| 11 | into the dir, as follows. |
| 12 | |
| 13 | {{{ |
| 14 | #!sh |
| 15 | hg clone http://lemon.cs.elte.hu/hg/lemon-contrib-template myproject |
| 16 | cd myproject |
| 17 | }}} |
| 18 | |
| 19 | As you probably want to use LEMON in your project, you will need it too. For this you have to options. You can either install it somewhere or use a local copy of LEMON dedicated to your project. This later option is especially useful if you also modify/develop LEMON along with your project, or want to use a specific version. |
| 20 | |
| 21 | === Use a preinstalled version. === |
| 22 | |
| 23 | See the [InstallGuide LEMON Install Guide] for instructions on how to install LEMON. If you installed it to a non-standard place, you must let CMAKE know where to find it in the LEMON_ROOT_DIR config variable. |
| 24 | |
| 25 | === Use LEMON as a subproject. === |
| 26 | |
| 27 | Just simply copying the LEMON source code into the 'lemon' subdir will do the job. Namely, you can either extract a release tarball |
| 28 | |
| 29 | {{{ |
| 30 | #!sh |
| 31 | wget http://lemon.cs.elte.hu/pub/sources/lemon-1.1.tar.gz |
| 32 | tar xzf lemon-1.1.tar.gz |
| 33 | mv lemon-1.1 lemon |
| 34 | }}} |
| 35 | |
| 36 | or - even better - you can check out the mercurial LEMON repository |
| 37 | |
| 38 | {{{ |
| 39 | #!sh |
| 40 | hg clone http://lemon.cs.elte.hu/hg/lemon-main lemon |
| 41 | }}} |
| 42 | |
| 43 | Then run CMAKE to create the makefiles and compile the code as usual. |
| 44 | |
| 45 | {{{ |
| 46 | #!sh |
| 47 | mkdir build |
| 48 | cd build |
| 49 | cmake-gui .. |
| 50 | make |
| 51 | }}} |
| 52 | |
| 53 | == Setup Your Own Project == |
| 54 | |
| 55 | Edit [http://lemon.cs.elte.hu/hg/lemon-contrib-template/file/tip/CMakeLists.txt CMakeLists.txt] to change the name of the project and the source files. Simply follow the instructions in [http://lemon.cs.elte.hu/hg/lemon-contrib-template/file/tip/CMakeLists.txt CMakeLists.txt]. |