Configuring DIET's compilation: cmake quick introduction

If you are already experienced with cmake then using it to compile DIET should provide no surprise. DIET respects cmake's best practices e.g., by clearly separating the source tree from the binary tree (or compile tree), by exposing the main configuration optional flag variables prefixed with DIET_ (and by hiding away the technical variables) and by not postponing configuration difficulties (in particular the handling of external dependencies like libraries) to compile stage.

cmake classically provides two ways for setting configuration parameters in order to generate the makefiles in the form of two commands ccmake and cmake (the first one has an extra "c" character):

ccmake [options] <path-to-source>
in order to specify the parameters interactively through a GUI interface
cmake [options] <path-to-source> [-D<var>:<type>=<value>]
in order to define the parameters with the -D flag directly from the command line.
In the above syntax description of both commands, <path-to-source> specifies a path to the top level of the source tree (i.e., the directory where the top level CMakeLists.txt file is to be encountered). Also the current working directory will be used as the root of the build tree for the project (out of source building is generally encouraged especially when working on a CVS tree).

Here is a short list of cmake internal parameters that are worth mentioning:

Eventually, here is a short list of ccmake interface tips:

The DIET Team - Mer 29 nov 2017 15:09:02 EST