presets: Add install presets for `cmake --install --preset`
I am aware from #23208 that presets can be installed using the following commands:
cmake -S . --preset default
cmake --build --preset default --target install
But what I would like to do instead is split cmake --build --preset default
and cmake --install --preset default
into different commands, so that I can run the build without sudo
, and run the install part only with sudo
. I'd rather not run the build as sudo
because I want to retain ownership of all the files in the build directory.
I am also aware that I can run cmake --build --preset default
followed by cmake --build --preset default --target install
, but this seems suboptimal because it reruns the build before running the install, which adds some unnecessary overhead.
Lastly, I know that it is possible to split cmake --build
and cmake --install
into separate commands when passing the build directory (i.e. not using presets), so it seems inconsistent to me that this is not possible when using presets.
Is it going to be possible to implement what I'm asking for?
Here are all of my files, including a log file of the commands I ran.