CMakePresets.json: Rework how --preset argument is handled

If a path argument with no -S or -B leads to a cache directory, use that directory as the binary directory. Otherwise, use the binary directory from the preset.

Fixes: #21311 (closed)
Backport: release

Merge request reports

Loading