The -needed_framework option and has the same linker constraints as To link with the framework even if no symbols are used from it. This is similar to the FRAMEWORK feature, except it forces the linker Well as the suffix of the framework library name are now supported by New in version 3.25: The FRAMEWORK_MULTI_CONFIG_POSTFIX_ target property as For a file path, if itĬontains a directory part, that directory will be added as a framework If a target is given, that target must have theįRAMEWORK target property set to true. The framework can be specified as a CMake framework target, a bare framework Provided with Xcode, or one compatible with it). It can only be used on Apple platforms,Īnd only with a linker that understands the option used (i.e. This option tells the linker to search for the specified framework using When using a MSVC or MSVC-like toolchain, the MSVC version must Due to a limitation of the Apple linker, itĬannot be specified as a plain library name like foo, where foo The library must be specified as a CMake target name,Ī library file name (such as libfoo.a), or a library file path (such as Supported for the following platforms, with limitations as noted:Īll Apple variants. WHOLE_ARCHIVEįorce inclusion of all members of a static library. LINK_LIBRARY_OVERRIDE_ target properties. This feature corresponds to standard linking, essentially equivalent to The pre-defined built-in library features are: DEFAULT Feature names defined in all uppercase are reserved for CMake's This specifies that lib2 should link to lib1 and use theįeature names are case-sensitive and may only contain letters, numbers and ) target_link_libraries( lib2 PRIVATE "$" ) Link Features ¶ $ ¶Īdd_library( lib1 STATIC. See the note related to $ for constraints about the usage of this LibC_Clang will be added as link dependency and libC_Intel when Likewise when the C linker is Clang or AppleClang, target Linker, and libCXX_Intel when Intel is the CXX linker. This example will have target libCXX_ClangĪs link dependency when Clang or AppleClang is the CXX This specifies the use of different link libraries based on both theĬompiler id and link language. ) add_executable( myapp main.c ) if ( CXX_CONFIG ) target_sources( myapp PRIVATE file.cxx ) endif() target_link_libraries( myapp PRIVATE $: libCXX_Clang > $: libC_Clang > $: libCXX_Intel > $: libC_Intel > ) Using CXX if there are any C++ sources and otherwise using C.Ī workaround is to create separate libraries for each source file languageĪdd_library( libC_Clang. 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). $ ¶Ī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. List() command, it is specific to the list-handling generator Since a comma is used to separate the list and the value, the listĬannot itself contain a comma. Must not contain any commas if that generator expression expects something toīe provided after the list. In each of the following list-related generator expressions, the list List() command, providing the same capabilities, but in Most of the expressions in this section are closely associated with the Same behavior as string(MAKE_C_IDENTIFIER). $ ¶Ĭontent of string converted to upper case. String Transformations ¶ $ ¶Ĭontent of string converted to lower case. They have the formġ if v1 is a version greater than or equal to v2, else 0. 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 |