
Cmake generator expression manual#
See theĬmake-compile-features(7) manual for information onĬompile features and a list of supported compilers. Increases the required C_STANDARD or CXX_STANDARDįor the ‘head’ target, an error is reported. The link implementation of a target and if any dependency transitively If this expression is used while evaluating Where features is a comma-spearated list.Įvaluates to 1 if all of the features are available for the ‘head’
Cmake generator expression generator#
This generator expression only works for a subset of If the policy was not set, the warning message for the policy $ġ if the version of the CXX compiler matches version, otherwise 0.ġ if the version of the OBJC compiler matches version, otherwise 0.ġ if the version of the OBJCXX compiler matches version, otherwise 0.ġ if the version of the Fortran compiler matches version, otherwise 0.ġ if the version of the ISPC compiler matches version, otherwise 0.ġ if the policy was NEW when the ‘head’ target was created,Įlse 0. See also the CMAKE_COMPILER_VERSION variable. $ġ if the CMake’s compiler id of the CXX compiler matches any oneġ if the CMake’s compiler id of the CUDA compiler matches any oneġ if the CMake’s compiler id of the Objective-C compiler matches any oneġ if the CMake’s compiler id of the Objective-C++ compiler matches any oneġ if the CMake’s compiler id of the Fortran compiler matches any oneġ if the CMake’s compiler id of the ISPC compiler matches any oneġ if the version of the C compiler matches version, otherwise 0. Of the entries in compiler_ids, otherwise 0. Where compiler_ids is a comma-separated list.ġ if the CMake’s compiler id of the C compiler matches any one Where platform_ids is a comma-separated list.ġ if the CMake’s platform id matches any one of the entries in MAP_IMPORTED_CONFIG_ is also considered by thisĮxpression when it is evaluated on a property on an IMPORTED Variable Queries ¶ $ġ if config is any one of the entries in cfgs, else 0.

$ġ if v1 is a version greater than or equal to v2, else 0.

$ġ if v1 is a version less than or equal to v2, else 0. $ġ if v1 is the same version as v2, else 0. $ġ if v1 is a version greater than v2, else 0. $ġ if string is member of the semicolon-separated list, else 0.ġ if v1 is a version less than v2, else 0. $ġ if value1 and value2 are numerically equal, else 0.

For a case-insensitive comparison,Ĭombine with a string transforming generator expression, String Comparisons ¶ $ġ if string1 and string2 are equal, else 0. Where conditions is a comma-separated list of boolean expressions.Įvaluates to 1 if at least one of the conditions is 1.Ġ if condition is 1, else 1. String ends in the suffix -NOTFOUND (case-sensitive). Evaluates to 0 if any of theĠ, FALSE, OFF, N, NO, IGNORE, or NOTFOUND, or They are typically used to construct the condition in a conditionalĪvailable boolean expressions are: Logical Operators ¶ $Ĭonverts string to 0 or 1. Boolean Generator Expressions ¶īoolean expressions evaluate to either 0 or 1. Generator expressions can be nested, as shown in most of the examples below. around placeholders like condition, string, target, To avoid confusion, this pageĭeviates from most of the CMake documentation in that it omits angular brackets The build configuration, target properties, platform information or any other

They enable conditional linking, conditional definitions used when compiling,Ĭonditional include directories, and more. Target_include_directories(), target_compile_definitions() They may also be used when usingĬommands to populate those properties, such as target_link_libraries(), Such as LINK_LIBRARIES, INCLUDE_DIRECTORIES,ĬOMPILE_DEFINITIONS and others. Generator expressions are allowed in the context of many target properties, Information specific to each build configuration. Generator expressions are evaluated during build system generation to produce
