#pragma requires
directives
#pragma requires
is recognized by both genom-pcpp
preprocessor and GenoM. It indicates an external dependency on a
software package that is required to parse the current
specification. #pragma requires
assumes that the package is using
the pkg-config
utility (see
http://www.freedesktop.org/wiki/Software/pkg-config) and a
.pc
is available. This has the same effect as placing
requires
directives in all components (see Component declaration) but saves the need pass -I
and -D
directives to
genom (see General options) as they are automatically
computed.
The pragma syntax is as follow:
#pragma requires "package [ >= version ]"
#pragma requires
accepts a string argument in the form package
[>= version]
. genom-pcpp
interprets it by running pkg-config
--cflags
on the string argument. It then adds the resulting -I
and
-D
flags as if they had been passed on the command line. Note that
the flags are added at the current processing location, so they do
not influence already preprocessed input. The pkg-config
utility is
found in PATH, or via the PKG_CONFIG environment variable if
defined (see Environment variables).
The pragma argument is also added to the require
property of
all the components defined in a specification.