COIN-OR::LEMON - Graph Library

Version 6 (modified by Peter Kovacs, 15 years ago) (diff)


LEMON Project Template

The aim of the template repository is to make it easier to setup a new LEMON based project. It provides a cross platform 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.

hg clone 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 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

tar xzf lemon-1.1.tar.gz
mv lemon-1.1 lemon

or - even better - you can check out the mercurial LEMON repository

hg clone 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:

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 here.

Then run CMake to create the makefiles and compile the code as usual.

mkdir build
cd build
cmake-gui ..

Setup Your Own Project

Edit CMakeLists.txt to change the name of the project and the source files. Simply follow the instructions in CMakeLists.txt.

Attachments (1)

Download all attachments as: .zip