メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

target.CMakeCacheEntry クラス

名前空間: target

Configure a CMake cache entry

R2022b 以降

Description

Use a target.CMakeCacheEntry object to define a CMake cache entry for the CMake tool. The software adds the cache entry to the command that invokes CMake, using one of these forms:

  • -D Name:Type=Value

  • -D Name=Value

Name, Type, and Value are object properties.

To create a target.CMakeCacheEntry object, use the target.create function.

プロパティ

すべて展開する

Name of the CMake cache entry.

If the string value has spaces, for example, name With Spaces, the software passes to the CMake tool the value with double quotes, that is, "name With Spaces".

Attributes:

GetAccess
public
SetAccess
public

Optional. Type of the CMake cache entry.

If the string value has spaces, for example, name With Spaces, the software passes to the CMake tool the value with double quotes, that is, "name With Spaces".

Attributes:

GetAccess
public
SetAccess
public

Value of the CMake cache entry.

If the string value has spaces, for example, name With Spaces, the software passes to the CMake tool the value with double quotes, that is, "name With Spaces".

Attributes:

GetAccess
public
SetAccess
public

すべて折りたたむ

This code snippet shows how you can use the target.CMakeCacheEntry object to define CMake cache entries for the CMake tool.

tc = target.create('Toolchain', 'Name', 'CMake/Ninja for all hosts');
tc.Builder = target.create('CMakeBuilder');
tc.Builder.Generator = 'Ninja';
tc.Builder.CommandLineCacheEntries(end+1) = ...
   target.create('CMakeCacheEntry', 'Name', 'CMAKE_C_COMPILER', 'Value', 'gcc');
tc.Builder.CommandLineCacheEntries(end+1) = ...
   target.create('CMakeCacheEntry', 'Name', 'CMAKE_CXX_COMPILER', 'Value', 'g++');

バージョン履歴

R2022b で導入