Presets-related error messages don't provide enough information
When there is a problem with a CMakePresets.json
or CMakeUserPresets.json
file, the error messages that are generated are not very helpful. If the JSON file contains any sort of syntax error, you get no help with where in the file the error came from. All you get in the error message is something like this:
Could not read presets from /Some/Path/Blah: JSON parse error
JSON syntax errors can be very difficult to find manually without any guidance on where the error is located. Can the JSON parsing CMake uses provide a line number, JSON path or something similar to help the user locate the problem?
A related but slightly different variant of this is when the JSON syntax is valid, but the contents are rejected by CMake. For example, if you happen to use a wrong data type, such as giving a quoted "true"
instead of just true
to the hidden
field of a configurePresets
entry, you get told a preset is invalid, but not which preset or why it is invalid. The error message in such cases is just this:
Could not read presets from /Some/Path/Blah: Invalid preset