Preset file grayed-out in the GUI

I’m using the json presets feature for the first time. I’m having a problem with the CMake GUI. When I start-up the GUI and aim it for my source directory, it finds the json file, but it appears grayed-out in the Presets selection box. What could be wrong?
CMakePresets.json (999 Bytes)


Possibly your presets file is malformed and fails to parse. You could verify that at the command line by trying to run cmake --list-presets from the top of your source tree. From a quick look at your presets file, I think your generator field is incorrect. The value is case-sensitive, so you probably wanted Unix Makefiles instead there.

1 Like

The GUI should probably have a tooltip (at least) or some kind of notification that the preset is invalid (ideally with a useful error message).

1 Like

I had previously run cmake --list-presets and there were no problems. The solution was the second thing you mentioned: I had to change UNIX to Unix to solve the problem.

For completeness I want to also mention that for booleans that show as checkboxes in the GUI, the correct settings in json are true and false, which are case-sensitive, without quotes. After I made all of these changes, the file worked correctly.