CMake

Overview | CMake | Git | Documenting

This page is divided into the following sections:

Compiling TNG

For compiling TNG you need to install the following tools:

TNG ships log4cxx and APR (Apache Portable Runtime project) which require

Although cmake is heavily used to create a makefile environment the main makefile in the root directory must never be overwritten.

You can get a help screen using

 make help 

The idea is to compile external "third-party" libraries and own sources in separate environments.

The external libs are located in the path ./Externals and can be compiled and cleaned by

make externals 
make clean_externals 

The TNG sources are distinguished into modules (separated libraries) and drivers (executables). Each of these parts provides its own testing environment and CMake build tree/Makefiles. But it is possible to compile all in one build tree using the Makefile in the root directory:

 make 

 make clean 
deletes all libs and objects

 make distclean 
deletes the build tree and the CMake cache as well.

With CMake you can compile using parallel compiler processes. If any errors occur it is a matter of wrong dependencies in your CMakelists.txt files. At the moment in order to start XX processes, you have to type:

make -jXX 

In order to compile this documentation, type

make cmake doc

Adding a module

Modules are encapsulated parts which are NOT third-party libraries, but which may be considered as standalone libraries. They may depend on TNG's external libraries and on other modules. They are encapsulated in order to enable and disable certain functionalities.

A module must be added to the module directory with the following directory structure:

Any module must be announced to configuration files in the upper levels. In /modules/CMakeLists.txt one has to add the new module to the list of modules and one has to set its dependencies, but only the dependencies onto other modules. Dependencies on external libraries must be defined in the own CMakeLists.txt.

The usual CMakeLists.txt

Adding a driver

Drivers are executables which provide individual implementations of the TNG modules. Popular drivers are

A driver must be added to the drivers directory with the following directory structure:

Any driver must be announced to configuration files in the upper levels. In /drivers/CMakeLists.txt one has to add the new driver to the list of drivers and one has to set its dependencies, but only the dependencies onto other modules. Dependencies on external libraries must be defined in the own CMakeLists.txt.

The usual CMakeLists.txt

Links


Generated on Thu Nov 18 00:19:51 2010 for SLangTNG by  doxygen 1.5.6