Hi there, first of all I wanted to say the new “presets” feature is amazing and definitely has the possibility to fundementally change how we interact with CMake in the future.
However, for some reason the following usages do not seem to work and we are basically required to run the cmake command from the CMAKE_SOURCE_DIR only.
cmake --build --preset=default path-to-source
cmake --build --preset=default path-to-existing-build
cmake --build path-to-source --preset=default
cmake --build path-to-existing-build --preset=default
cmake --build --preset=default -S path-to-source
cmake --build --preset=default -B path-to-existing-build
cmake --build --preset=default -S path-to-source -B path-to-existing-build
If I manually cd to the CMAKE_SOURCE_DIR the following works:
cmake --build --preset=default
The equivalent of the above for the configure step all work though:
cmake --preset=default path-to-source
cmake --preset=default path-to-existing-build
cmake --preset=default -S path-to-source
cmake --preset=default -B path-to-existing-build
cmake --preset=default -S path-to-source -B path-to-existing-build
I believe the --build behavior should match the configure behavior. Am I missing something? I would think the -S argument or path to source would function similarly to the -C option in make/ninja. I might also suggest that a simple enviornment variable would be a good way for interactive users where I could simply export CMAKE_SOURCE_DIR and have it respected in all the various cmake utilities versus passing command line parameters.
I did look and I did not see this reported before.
*Edit: angle brackets didn’t show up correctly, so I removed them