$ cmake --build --preset=<myBuildPreset> ../..
Unknown argument ../..
CMake Error: Could not read presets from /mnt/c/<snip>/builds/myBuildDir: File not found
$ cmake --build --preset=<myBuildPreset> ../..
Unknown argument ../..
CMake Error: Could not read presets from /mnt/c/<snip>/builds/myBuildDir: File not found
Online documentation shows cmake --build --preset <preset> [<options>] [-- <build-tool-options>]. You don’t supply a directory path, the directory is required when not using --preset <preset>.
Try without the directory, this works for me when the current directory is the source directory: $ cmake --build --preset=<myBuildPreset>
Well, the documentation says CMakePresets.json and CMakeUserPresets.json live in the project's root directory. . To me this means they need to be in the source root directory. This is how I use it and its been working so far.
@fdk A very good point. Sorry, I think you’ve demonstrated that I haven’t thought this through properly. Thanks for your help. I will close the issue and mark your comment as the solution.