Main Content

target.EnvironmentConfiguration クラス

名前空間: target

ツールチェーンのシステム環境を構成する

R2022b 以降

説明

target.EnvironmentConfiguration オブジェクトを使用して、ツールチェーンのシステム環境を構成します。たとえば、環境変数の構成やベンダー提供の設定スクリプトの実行などを行います。

target.EnvironmentConfiguration オブジェクトの作成には関数 target.create を使用します。

プロパティ

すべて展開する

環境構成を適用するオペレーティング システム。

属性:

GetAccess
public
SetAccess
public

オプション。ソフトウェアで CMake の configure または build コマンドを実行する前に呼び出す設定シェル スクリプトまたはバッチ ファイル。

Windows® コンピューターでは、cmake を呼び出す前にソフトウェアはバッチ ファイルから CALL コマンドを実行します。

Linux® および Mac コンピューターでは、cmake を呼び出す前にソフトウェアは Bash シェル スクリプトから source または . コマンドを実行します。

属性:

GetAccess
public
SetAccess
public

オプション。cmake configure または build コマンドを実行する前にシステム パスの先頭に付加する必要があるパスのリスト。

属性:

GetAccess
public
SetAccess
public

すべて折りたたむ

カスタムの CMake ツールチェーン定義の作成からのこのコードの抜粋では、target.EnvironmentConfiguration オブジェクトを使用してツールチェーンのシステム環境を構成する方法を示します。

tc.EnvironmentConfiguration(1).HostOperatingSystemSupport.Linux = false;
tc.EnvironmentConfiguration(1).HostOperatingSystemSupport.Windows = true;
tc.EnvironmentConfiguration(1).HostOperatingSystemSupport.Mac = false;
tc.EnvironmentConfiguration(1).SystemPaths = ...
  {'$(MW_MINGW64_LOC)/bin', '$(MATLAB_ROOT)/toolbox/shared/coder/ninja/$(ARCH)'};

tc.EnvironmentConfiguration(2) = target.create('EnvironmentConfiguration');
tc.EnvironmentConfiguration(2).HostOperatingSystemSupport.Linux = true;
tc.EnvironmentConfiguration(2).HostOperatingSystemSupport.Windows = false;
tc.EnvironmentConfiguration(2).HostOperatingSystemSupport.Mac = true;
tc.EnvironmentConfiguration(2).SystemPaths = ...
  {'$(MATLAB_ROOT)/toolbox/shared/coder/ninja/$(ARCH)'};

バージョン履歴

R2022b で導入