= LEMON Project Template = The aim of [http://lemon.cs.elte.hu/hg/lemon-project-template the template repository] is to make it easier to setup a new LEMON based project. It provides a cross platform [http://cmake.org/ CMake] build environment. This guide assumes you use Linux or some other UN*X based system, but everything works equally well on Windows, too. == Setup and Build the Template == This is fairly easy. First, clone the project template repository and step into the dir, as follows. {{{ #!sh hg clone http://lemon.cs.elte.hu/hg/lemon-project-template myproject cd myproject }}} As you probably want to use LEMON in your project, you will need it too. For this you have two 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. === Use a preinstalled version === 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. === Use LEMON as a subproject === Just simply copying the LEMON source code into the 'lemon' subdir will do the job. Namely, you can either extract a release tarball {{{ #!sh wget http://lemon.cs.elte.hu/pub/sources/lemon-1.1.tar.gz tar xzf lemon-1.1.tar.gz mv lemon-1.1 lemon }}} or - even better - you can check out the mercurial LEMON repository {{{ #!sh hg clone http://lemon.cs.elte.hu/hg/lemon-main lemon }}} If you chose the latter and you are using Mercurial 1.3 or later, you can set the {{{lemon}}} repository as a subrepository of your project: {{{ #!sh echo 'lemon = lemon' > .hgsub hg add .hgsub hg ci -m'Add .hgsub' }}} For example, this has the benefit that you can clone your project repository together with the {{{lemon}}} repository. You can read more about subrepository support in Mercurial [http://mercurial.selenic.com/wiki/subrepos here]. Then run CMake to create the makefiles and compile the code as usual. {{{ #!sh mkdir build cd build cmake-gui .. make }}} == Setup Your Own Project == Edit [http://lemon.cs.elte.hu/hg/lemon-project-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-project-template/file/tip/CMakeLists.txt CMakeLists.txt].