hmm, I have been browsing the documentation for a while now, but I don’t really see a way to do this.
I don’t see options in the Visual studio generators to set this part of the project. And certainly not for the plugins.
I also searched if it is possible to give some sort of template to the generator, or if it is possible to run a script after generation to change the solution file (if that allows you to change these settings). But this link tells me that the latter is also not possible or a good idea: https://stackoverflow.com/questions/7091447/run-command-after-generation-step-in-cmake
One other thing I was thinking about:
You should check where these specific settings are stored in your project. If cleaning removes the settings, then it has to be somewhere in the folder. It could be in the solution file, or more likely somewhere in the hidden .vs folder.
If there is indeed a file that stores this (and it is not the solution file), then you can keep a copy of those settings in your repo and tell cmake to copy that file into the .vs folder during the configuration phase.
But it kind of all depends on where these specific settings are stored by Visual Studio.
But in general I don’t think there is a CMake way of doing what you want.