Need ability to clean individual targets after they were build (e.g. with Make)
I would like to be able to clean single targets, without their dependencies, in CMake-configured builds.
Ideally, something like:
cmake --build build_dir --target my_tgt --clean
would be the syntax.
Currently I can clean everything with
cmake --build build_dir --target clean
or
make clean
in the build directory, but I don't have anything at a finer resolution than that.
With ninja, things are better:
ninja -t clean my_target
but I still want to do this via CMake.
Bonus points if I can ask for cleaning along with all prerequisite targets or just the specific target.