# CMake

> **TL;DR**
> `Settings | Build, Execution, Deployment | CMake`

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

![CMake settings dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_cmakesettings_overview.png)

| Item | Description |
| --- | --- |
| Reload CMake project on editing CMakeLists.txt or other CMake configuration files |    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 reload option](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_reload_cmake.png)   However, if some external changes take place (for example, an update from version control), the project reloads anyway.    |

## Profiles

| Item | Description |
| --- | --- |
|  Profiles  |     In this field, select a [CMake profile](cmake-profile.html). You can edit, delete, or add profiles here.        * Click the ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) button to add a profile to the list. By default, profile is named according to the currently selected build type and toolchain.    * Click the ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.remove.svg) button to delete the selected profile from the list.    * Click the ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.copy.svg) button to create a copy of the selected profile.     Note: this list of CMake profiles determines the profiles available in the [Run/Debug Configurations](run-debug-configuration.html) switcher and the list of [resolve contexts](switching-resolve-context.html).     |
|  Enable profile  |  If you disable a profile, it will not be included in CMake reload. Use this option to disable the profiles you don't need at the moment.  |
|  Name  |  This field represents the name of the selected profile.  |
|  Build type  |    From this drop down list, select the desired [build type](cmake-profile.html#buildtypes).     By default, in case this field has not been set manually, the type is Debug.     Note that the Default option corresponds to the empty value of [CMAKE_BUILD_TYPE](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html).    |
|  Toolchain  |    From this drop down list, select the desired toolchain. This list consists of toolchains you created in the Toolchain settings dialog.     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).    |
| Generator |    Here you can select the [CMake generator](cmake-profile.html#cmake-generators):      ![Generators drop down](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_cmakeprofile_generators_dropdown.png)   Alternatively, you can set the generator via CMake options. CLion updates both fields accordingly.    |
| CMake options | In this field, specify additional [CMake options](https://cmake.org/cmake/help/latest/manual/cmake.1.html#options), separated by spaces.     For example, here you can specify a custom [CMake generator](cmake-profile.html#cmake-generators) via `-G`.                       > **Tip:** > You can always press `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)) or click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.expandComponentHover.svg) to type in the editor window, each option on a new line.                      You can also insert project path macros in this field by clicking ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg):      ![CMake options macros](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_cmakeoptions_macros.png)  |
| Build directory |    Specify here the desired location for the generated CMake files. This path can be either absolute (for example, `c:\CLion_Projects\My_Project\cmake-build-debug`) or relative to the current project root (for example, `cmake-build-debug`).                       Leave this field empty to use the default location, which is `cmake-build-[buid_type]` under the project root.                       This setting is saved in `.idea/workspace.xml` and is not supposed to be shared.      > **Note:** > If you select a subdirectory of the project root as the generation output, the IDE marks the files of that subdirectory as excluded from the project and considers them as non-project files. Navigation actions like Navigate to file will not work for these files.    |
| Build options |     In this field, specify the options to be passed either to the build tool used by CMake or as command line parameters to CMake itself.      Options from this field are passed to CMake during the build phase (for more information, refer to the description of the CMake [build](https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-a-project) command).     For the arguments to be used by the underlying build tool (make, Ninja, or another one), they should be preceded with `--`. For example, if you specify `-j 5 --clean-first -- -d -p`, then `-j 5 --clean-first` will be processed by CMake, while `-d -p` will be passed to the build tool.                      If nothing is specified in this field, CLion uses the default settings, which depend on the selected environment. For example, if the make generator is selected, the default value is `-- -j <number_of_hardware_cores>`, while for Microsoft Visual C++ this field is empty.                       > **Tip:** > You can always click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.expandComponentHover.svg) to type the required options in the editor window.    |
| Environment |     Click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.inlineVariables.svg) to invoke the Environment Variables pane and select there the [environment variables](cmake-profile.html#EnvVariables) to be passed to CMake on the generation phase.        * Use ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg), ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.remove.svg), ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.copy.svg) and ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.paste.svg) buttons to manage the list of custom variables.    * Select the Include system environment variables checkbox link if you want the values you specify to be appended to system variables. Otherwise, when the checkbox is cleared, your custom values will overwrite the system ones.    |

## See also

### External Links

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

### How tos

[Tutorial: Configure CLion on Windows](quick-tutorial-on-configuring-clion-on-windows.html)

