-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Currently the CMakePresets.json contains the following
{
"name": "ci-build",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
The binaryDir here forces the build to go into the directory build in the source tree. I think this is a very bad idea.
Maybe for CI builds this is OK as you may spin up a totally new environment for every build but if you are building local copies
they can clash. For instance you use WSL and want to build a GCC and a VS build using the same source tree. This is how I ran
into this.
It is noticeable that in BUILDING.md all the examples contain the -B flag
cmake -B build --preset=test-msvc
So the -B is used to override the binaryDir in the CMakePresets.json.
I suspect the binaryDir in the CMakePresets.json is there because it used to be a required field.
I would suggest removing the binaryDir which means by default the build tree goes into the directory where you are running cmake which is what most people probably expect. You can always still override this on the command line using -B.
An alternative would be to add CMakePresets.json items for command line builders that don't inherit ci-build. The downside of this is that they might drift apart, say by flags, from the ci-* presets which are used by CI build.