What is use and significance of environment inherit in CMake Build Preset.

In CMake Build Preset inside CMakePresets.json also we can have environment and us inherit keyword to inherit properties from inherited build presets. Now in regard with CMake Config Preset these environment and inherits makes perfect sense because there I was to defined common build properties in one preset (say kernel) and will be inherited with multiple other presets like (OS presets) and finally (like Windows-x64) preset will inherits few presets and define few only few which is only applicable for config preset (Windows-x64) and we can not configure this final preset (Windows-x64).

But in case of Buildpreset, I am unable to find a real use case for the environment and inherit keyword. Can I give any build-related flags in my build preset? I guess not. Please help me to understand this .

Regards,
Mohsin Siddiqui

@craig.scott Could please help to understand above? Would appreciate your help on this.

A build preset can specify a number of different things. If you have a lot of build presets, some subset of those things might need to be set to the same thing for multiple build presets. For example, a number of build presets may want to use the same nativeToolOptions or targets. Rather than duplicating those things in each build preset, you could put them in a base preset (with hiddenset totrue`) and then make the build presets that need those things inherit from the base preset.

Thank You @craig.scott for clarification.