[cmake-developers] conditionals in generator expressions

Brad King brad.king at kitware.com
Mon May 21 08:54:49 EDT 2012


On 05/19/2012 04:45 PM, Alexander Neundorf wrote:
> On Thursday 17 May 2012, David Cole wrote:
>> I don't think this conditional stuff in generator expressions is a good
>> idea at all.
> 
> Me too ;-)

The goal is to allow per-configuration/per-language/per-xyz values to
appear in places like the INCLUDE_DIRECTORIES property of a target.
Unlike COMPILE_DEFINITIONS the *order* of include directories matters.
Therefore we cannot have a separate INCLUDE_DIRECTORIES_<CONFIG>
property because there is no well-defined way to integrate its entries
with those of the main property.  There was discussion of this back
when Stephen first brought up his patch for per-target include
directories.  The solution is to have a single property only and put
the condition in the value.

Since the configuration is not known until generate time any condition
based on the configuration must be evaluated at generate time.  We need
to have generate-time evaluation of a condition stored in a value of a
property.  This touches on a declarative specification.  The closest we
have to this now is the "debug" and "optimized" keywords of tll().

-Brad



More information about the cmake-developers mailing list