# CMake

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

> **TL;DR**
> `設定 | ビルド、実行、デプロイ | CMake`

Use this page to configure [CMake profile](cmake-profile.html) settings for the current project.

![CMake の設定ダイアログ](https://resources.jetbrains.com/help/img/idea/2026.3/cl_cmakesettings_overview.png)

|  項目  |  説明  |
| --- | --- |
|  CMakeLists.txt または他の CMake 構成ファイルの編集時に CMake プロジェクトを再ロードする  |     If this checkbox is selected, CLion automatically reloads your project when you edit [CMakeLists.txt](cmakelists-txt-file.html) or [CMakePresets.json](cmake-presets.html).       If this checkbox is cleared, CLion displays a pop-up message where you can choose to reload the current project manually or enable the automatic reload (which leads to selecting this checkbox):      ![CMake 再ロードオプション](https://resources.jetbrains.com/help/img/idea/2026.3/cl_reload_cmake.png)    ただし、何らかの外部変更（バージョン管理からの更新など）が発生した場合、プロジェクトは再読み込みされます。     |

## プロファイル

|  項目  |  説明  |
| --- | --- |
|  プロファイル  |     In this field, select a [CMake profile](cmake-profile.html). ここでプロファイルを編集、削除、追加できます。        * ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) ボタンをクリックして、プロファイルをリストに追加します。 デフォルトでは、プロファイルは現在選択されているビルドタイプとツールチェーンに従って名前が付けられます。    * 選択したプロファイルをリストから削除するには、 ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.remove.svg) ボタンをクリックします。    * 選択したプロファイルのコピーを作成するには、 ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.copy.svg) ボタンをクリックします。        メモ   : この CMake プロファイルのリストは、 [実行 / デバッグ構成](run-debug-configuration.html)スイッチャーで使用可能なプロファイルと [解決コンテキスト](switching-resolve-context.html)のリストを決定します。     |
|  プロファイルを有効にする  |  プロファイルを無効にすると、CMake の再ロードには含まれません。 このオプションを使用して、現時点で不要なプロファイルを無効にします。  |
|  命名方法名  |  このフィールドは、選択したプロファイルの名前を表します。  |
|  ビルドタイプ  |     From this drop down list, select the desired [build type](cmake-profile.html#buildtypes).       デフォルトでは、このフィールドが手動で設定されていない場合、タイプは   デバッグ   です。         デフォルト   オプションは [CMAKE_BUILD_TYPE(英語)](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) の空の値に対応することに注意してください。     |
|  ツールチェーン  |     このドロップダウンリストから、目的のツールチェーンを選択します。 このリストは、ツールチェーン設定ダイアログで作成したツールチェーンで構成されています。       If nothing is selected, then CLion uses the [toolchain](how-to-create-toolchain-in-clion.html) that is currently set as default (the first one in the toolchains list).     |
|  生成プログラム  |     ここで [CMake ジェネレーター](cmake-profile.html#cmake-generators)を選択できます:      ![ジェネレーターのドロップダウン](https://resources.jetbrains.com/help/img/idea/2026.3/cl_cmakeprofile_generators_dropdown.png)    または、   CMake のオプション   を介してジェネレーターを設定することもできます。 CLion updates both fields accordingly.     |
|  CMake のオプション  |     このフィールドでは、スペースで区切って追加の [CMake のオプション(英語)](https://cmake.org/cmake/help/latest/manual/cmake.1.html#options)を指定します。       例: ここでは、  `-G`  を介してカスタム [CMake ジェネレーター](cmake-profile.html#cmake-generators)を指定できます。      > **Tip:** > 常に `Shift+Enter` (Windows), `⇧ ⏎` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⇧ ⏎` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Ctrl+Enter` (Sublime Text), `⌘ ⏎` (Sublime Text (macOS)), `⇧ ⏎` (Xcode), `Shift+Enter` (Visual Studio), `⇧ ⏎` (Visual Studio (macOS)), `Shift+Enter` (ReSharper), `⇧ ⏎` (ReSharper (macOS)), `Shift+Enter` (QtCreator), `⌘ ⏎` (QtCreator (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Eclipse), `⇧ ⏎` (Eclipse (macOS)) を押すか、 ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.expandComponentHover.svg) をクリックしてエディターウィンドウに入力し、各オプションを新しい行に入力できます。      ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) をクリックして、このフィールドにプロジェクトパスマクロを挿入することもできます。      ![CMake オプションマクロ](https://resources.jetbrains.com/help/img/idea/2026.3/cl_cmakeoptions_macros.png)  |
|  ビルドディレクトリ  |     ここで、生成された CMake ファイルの目的の場所を指定します。 このパスは、絶対パス（たとえば、  `c:\CLion_Projects\My_Project\cmake-build-debug`  ）または現在のプロジェクトルートに対する相対パス（たとえば、  `cmake-build-debug`  ）のいずれかです。       プロジェクトのルートの  `cmake-build-[buid_type]`  であるデフォルトの場所を使用するには、このフィールドを空のままにします。       この設定は  `.idea/workspace.xml`  に保存され、共有されることはありません。      > **Note:** > 生成出力としてプロジェクトルートのサブディレクトリを選択すると、IDE はそのサブディレクトリのファイルをプロジェクトから除外するものとしてマークし、非プロジェクトファイルと見なします。   ファイルに移動する   などのナビゲーションアクションは、これらのファイルでは機能しません。    |
|  ビルドオプション  |     このフィールドでは、CMake が使用するビルドツールに渡すオプション、または CMake 自体のコマンドラインパラメーターとして渡すオプションを指定します。       このフィールドのオプションは、ビルドフェーズ中に CMake に渡されます (詳細については、CMake [ビルド(英語)](https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-a-project)コマンドの説明を参照してください)。       基礎となるビルドツール（make、Ninja、別のツール）で使用される引数については、それらの前に  `--`  を付ける必要があります。 例:  `-j 5 --clean-first -- -d -p`  を指定すると、  `-j 5 --clean-first`  は CMake によって処理され、  `-d -p`  はビルドツールに渡されます。       このフィールドに何も指定されていない場合、CLion は選択した環境に応じてデフォルト設定を使用します。 例:   make   ジェネレーターを選択した場合、デフォルト値は  `-- -j <number_of_hardware_cores>`  ですが、Microsoft Visual C++ の場合、このフィールドは空になります。      > **Tip:** > 常に ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.expandComponentHover.svg) をクリックして、エディターウィンドウに必要なオプションを入力できます。    |
|  環境  |     Click ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.inlineVariables.svg) to invoke the   環境変数   pane and select there the [environment variables](cmake-profile.html#EnvVariables) to be passed to CMake on the generation phase.        * ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) 、 ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.remove.svg)、 ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.copy.svg)、 ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.paste.svg) ボタンを使用して、カスタム変数のリストを管理します。    * 指定した値をシステム変数に追加する場合は、 システム環境変数を含める チェックボックスリンクを選択します。 それ以外の場合、チェックボックスをオフにすると、カスタム値がシステムの値を上書きします。    |

## See also

### 外部リンク

[CMake documentation](http://www.cmake.org/documentation)

### ハウツー

[チュートリアル: Windows で CLion を設定する](quick-tutorial-on-configuring-clion-on-windows.html)

