# CMake presets

[CMake Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) are a way to configure and share CMake options using two files:

* `CMakePresets.json` for project-wise builds. This file can be shared via VCS.

* `CMakeUserPresets.json` for developers' own local builds. This file should not be checked into VCS.

Both `CMakePresets.json` and `CMakeUserPresets.json` have the same format and should be located in the project's root directory.

> **Note:**
> CLion supports Presets versions 2–10 and only [configure](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset) and [build](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#build-preset) presets.

[CMake Profiles](cmake-profile.html) have many settings in common with CMake Presets and are also shareable via VCS. The major difference is that profiles reference CLion [toolchains](how-to-create-toolchain-in-clion.html), which contain information that is not present and not needed in CMake presets (like the debugger or environment settings).

## Presets import

On project opening, CLion detects all build and configure presets in `CMakePresets.json` and `CMakeUserPresets.json` files under the project root. By default, all of them are loaded automatically into [CMake profiles](cmake-profile.html) in read-only mode.

> **Tip:**
> In case you don't want the presets to be converted into CMake profiles, or if you want to exclude configure or build profiles, go to `Settings | Advanced Settings` and use the Automatically import CMake Presets switcher:
>
> ![CMake Presets enabling options](https://resources.jetbrains.com/help/img/idea/2026.2/cl_advancedsettings_cmake_presets.png)

To view the loaded presets, go to `Settings | Build, Execution, Deployment | CMake` or use the View link in the notification dialog:

![Presets loaded notification](https://resources.jetbrains.com/help/img/idea/2026.2/cl_load_presets_notification.png)

* All new presets are disabled by default, unless you have already loaded and enabled them before (CLion matches them by name).

* All previously loaded presets are removed if they are not present in the `CMakePresets.json` or `CMakeUserPresets.json` files.

![Presets profiles initial state](https://resources.jetbrains.com/help/img/idea/2026.2/cl_presets_profiles_initial.png)

> **Note:**
> Presets loading is also triggered by the [Reset Cache and Reload](cmake-cache.html) and [Load CMake Project](reloading-project.html#CMakeNotDetected) actions.

Procedure: Load Presets manually

You can also load presets for an already opened project.

1. Call `Help | Find Action` (`Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `⌘ ⇧ A` (Xcode), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (ReSharper), `⌘ ⇧ A` (ReSharper (macOS)), `Ctrl+Shift+A` (QtCreator), `⌘ ⇧ A` (QtCreator (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS))) and search for Load CMake Presets.

2. CLion will show a popup with a list of the existing build presets:

![Load CMake Presets popup](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmakepresets_popup.png)

3. Select the preset and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

You can select several entries by holding `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (Xcode), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (ReSharper), `Ctrl` (ReSharper (macOS)), `Ctrl` (QtCreator), `Ctrl` (QtCreator (macOS)), `Ctrl` (NetBeans), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) or `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Xcode), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (ReSharper), `Shift` (ReSharper (macOS)), `Shift` (QtCreator), `Shift` (QtCreator (macOS)), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)). CLion will load all the selected presets.

4. Similarly to the case of opening a project, the presets you load manually are imported into CMake profiles in read-only mode. You can find them in `Settings | Build, Execution, Deployment | CMake`.

Procedure: Enable a Presets profile

1. Go to `Settings | Build, Execution, Deployment | CMake`.

2. Select the desired profile and set the Enable profile checkbox:

![Enabling a presets profile](https://resources.jetbrains.com/help/img/idea/2026.2/cl_presets_enable.png)

> **Tip:**
> To build your project with the enabled profile, select it in the configuration switcher and build ![the Build button](https://resources.jetbrains.com/help/img/idea/2026.2/app.toolwindows.toolWindowBuild.svg) the configuration or call one of the available [build actions](build-actions.html). See [Build with a profile](cmake-profile.html#CMakeProfileSwitcher).

## Editing Presets

There are two options you can use to edit the imported presets:

* [Edit a copy of a presets-based CMake profile](#presets-copy-edit)

* [Modify the corresponding JSON files in the editor](#edit-presets-json)

Procedure: Edit a copy of a presets-based CMake profile

1. Go to `Settings | Build, Execution, Deployment | CMake`.

2. Select the desired profile and click ![](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.copy.svg) or press `Ctrl/⌘ + D`:

![Copying a presets-based profile](https://resources.jetbrains.com/help/img/idea/2026.2/cl_presets_copyaction.png)

3. Adjust the settings in the copied profile:

![Editing a copied presets-based profile](https://resources.jetbrains.com/help/img/idea/2026.2/cl_presets_edit_copied.png)

Procedure: Modify the corresponding JSON files in the editor

* Open and start editing the corresponding `json` file. CLion will track changes as you type and notify you about any errors in the Problems view:

![CMake presets error reporting](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmakepresets_errors.png)

* When you change a preset file in the editor or modify it externally, you will get a notification suggesting to reload the changes:

![Editing a CMake preset JSOn file](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmakepresets_editing.png)

* Click Enable Auto-Reload if you prefer CLion to reload the changes silently. This sets the corresponding checkbox in the profiles settings:

![CMake profiles auto-reload](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmakepresets_autoreload.png)

### Changing the toolchain

By default, the loaded preset is linked to the default CLion [toolchain](how-to-create-toolchain-in-clion.html).

To set one of the already configured toolchains, modify the vendor-specific field of the configure preset.

For example, use the following code to switch to a toolchain called Clang10:

```JSON
"vendor": {
    "jetbrains.com/clion": {
      "toolchain": "Clang10"
    }
}
```

As a result, the Clang10 toolchain will be assigned to the loaded preset:

![A loaded CMake preset](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmakepreset_profile.png)

On Windows, if you are working with the [MSVC toolchain](quick-tutorial-on-configuring-clion-on-windows.html#MSVC), the architecture and toolset properties from the configure preset will be fetched to CMake options as well:

![CMake Presets MSVC options](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmakepresets_windows_options.png)

## Condition support

CLion supports the `condition` field in the `CMakePresets.json` and `CMakeUserPresets.json` files to filter presets. Note that only the `equals` and `notEquals` types are supported.

Here is an example of how to filter a preset by platform:

```JSON
{
    "name": "windows-only",
    "inherits": "default",
    "displayName": "Windows-only configuration",
    "description": "This build is only available on Windows",
    "condition": {
      "type": "equals",
      "lhs": "${hostSystemName}",
      "rhs": "Windows"
  }
}
```

After you configure filtering by platform, the corresponding preset will only appear in your [preset profile list](cmake-profile.html) on the platform for which it is enabled.

Learn more about the `condition` field options in the [CMake documentation](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#condition).

## Python integration

If you have a [Python interpreter](python-interpreter-for-cmake-projects.html) configured for your project, it can also be passed to a CMake preset. This requires explicitly setting the `enablePythonIntegration` flag in the preset attribute. Here is an example:

```JSON
...
  "configurePresets": [
    {
      "name": "default",
      "vendor": {
        "jetbrains.com/clion": {
          "toolchain": "Default",
          "enablePythonIntegration": true
        }
      }
    }
  ],
...
```

After the `vendor` field is configured, the Python interpreter will be passed to the appropriate CMake profile.

## See also

### Tutorials

[Quick CMake tutorial](quick-cmake-tutorial.html)

### How tos

[CMake profiles](cmake-profile.html) [Load/reload CMake](reloading-project.html) [Toolchains](how-to-create-toolchain-in-clion.html)

### Reference

[Advanced Settings](advanced-settings.html)

