How to save a build configuration as a preset

nRF Connect for VS Code

tags
nRF Connect for VS Code

You can save a build configuration you have made for your application as a CMake Preset, which stores the specific settings required for the build. Saving a preset stores this information in a CMakePresets.json file. This allows you to share build configurations when working with others.

To save a build configuration:

  1. Hover your mouse over the build directory.
  2. Click the menu icon More Actions > Save Configuration As Preset.

    Save Configuration As Preset

The current build configuration is saved to the CMakePresets.json file, which opens in the Editor after completing the action. The name of the preset corresponds to the displayName field in CMakePresets.json.

Alternatively, you can run nRF Connect: Save Configuration as Preset from the Command Palette, which also saves the build configuration to the CMakePresets.json file.