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>
cmake [options] <path-to-source> [-D<var>:<type>=<value>]
-D
flag directly
from the command line.
<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:
CMAKE_BUILD_TYPE
controls the type of build mode among which
Debug
will produce binaries and libraries with the debugging
information
CMAKE_VERBOSE_MAKEFILE
is a Boolean parameter which when set to
ON will generate makefiles without the .SILENT directive. This is
useful for watching the invoked commands and their arguments in case
things go wrong.
CMAKE_C[XX]_FLAGS*
is a family of parameters used for
the setting and the customization of various C/C++ compiler options.
CMAKE_INSTALL_PREFIX
variable defines the location
of the install directory (defaulted to /usr/local
on un*x).
This is cmake's portable equivalent of the autotools configure's
-prefix= option.
ccmake
interface tips:
ccmake
's most pertinent options (corresponding
keyboard shortcuts) depending on your current context
ccmake
embedded tutorial
and a list of keyboard shortcuts (as mentioned in the bottom
lines, hit "e" to exit)
enter
to edit path variables
PATH
typed parameter the TAB
keyboard
shortcut provides an emacs-like (or bash-like) automatic path completion.