![]() Generators, expressions for both C and C++ sources will be evaluated 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). For example:Ī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 > ) ![]() Particular language and compiler combination in a target. This expression may be used to specifyĬompile options, compile definitions, and include directories for source files of a The CMake’s compiler id of the language compiler matches any one of theĮntries in compiler_ids, otherwise 0. $ġ when the language used for compilation unit matches language and 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’ 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 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 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 ![]() This expression when it is evaluated on a property on an IMPORTED The mapping in MAP_IMPORTED_CONFIG_ is also considered by Generator expressions can be nested, as shown in most of the examples below.ġ if config is cfg, else 0. 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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |