Target-wide flags separately for C and CXX languages. Is no way to represent target-wide compile definitions or include directoriesĪlso, with Visual Studio Generators there is no way to represent Note that with Visual Studio Generators and Xcode there It also specifiesĪ COMPILING_CUDA compile definition for CUDA. This specifies the use of the -fno-exceptions compile option,ĬOMPILING_CXX compile definition, and cxx_headers includeĭirectory for C++ only (compiler id checks elided). $ ¶Īdd_executable( myapp main.cpp foo.c bar.cpp zot.cu ) target_compile_options( myapp PRIVATE $: - fno-exceptions > ) target_compile_definitions( myapp PRIVATE $: COMPILING_CXX > $: COMPILING_CUDA > ) target_include_directories( myapp PRIVATE $: /opt/foo/headers > ) $ ¶ġ if the version of the CXX compiler matches version, otherwise 0. $ ¶ġ if the version of the C compiler matches version, otherwise 0. See also the CMAKE_COMPILER_VERSION variable, which isĬlosely related to the expressions in this sub-section. $ġ if CMake's platform id matches any one of the entries inĬomma-separated list platform_ids, otherwise 0. Toolchain And Language Expressions ¶ Platform ¶ $ ¶ are evaluated using the custom command's "command config". With the Ninja Multi-Config generator, generator expressions Only valid in add_custom_command() and add_custom_target()Īs the outer-most generator expression in an argument. For example, the followingĮvaluates to 1 if $ is any of BAR, Bar, bar, etc. For a case-insensitive comparison,Ĭombine with a string transforming generator expression. String Comparisons ¶ $ ¶ġ if string1 and string2 are equal, else 0. Other more specific comparison types are documented in their own separate This section covers the primary and most widely used comparison types. Primary Comparison Expressions ¶ĬMake supports a variety of generator expressions that compare things. The result of the expression isĠ if condition is 1, else 1. If allĬonditions evaluate to 0, the whole expression evaluates to 0. Where conditions is a comma-separated list of boolean expressions.Įvaluates to 1 if at least one of the conditions is 1. The whole expressionĮvaluates to 1 if all conditions are 1. Where conditions is a comma-separated list of boolean expressions,Īll of which must evaluate to either 1 or 0. The common boolean logic operators are supported: $ ¶ $: - DENABLE_SOME_FEATURE > Logical Operators ¶ Information specific to each build configuration. Generator expressions are evaluated during build system generation to produce
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |