Visual Studio 2019 - Cmake Automatic script changes via add item
Hello.
I have a small problem regarding visual studio's "Add item" which is supposed to create new files and automatically add them to the cmake files.
To better explain what I have in mind, I will create a screenshot:
After clicking through the wizard, you will get a prompt where visual studio asks where to add the files. Unfortunately it only offers two options, where both of them are wrong.
My cmake has a large number of source groups and each one is then appended in a single set called "ALL FILES", which is then passed to the add_executable.
Visual studio does NOT seem to recognize the other variables created by the set only the ALL_FILES variable, which is directly then used in the add_excutable.
Visual studio discards all other sets unless they are directly used in the add_executable or add_library. Adding them to another set will discard them in the menu.
A temporary fix would be adding the sets to the add_executable directly, like so:
The issue now is that visual studio doesn't display the variable names and I have absolutely no idea which set is which, unless I manually click through them.
This generally makes the entire automatic cmake changes feature clumsy and very impractical to use.
A short example how Clion handles the very same feature:
I would really like to migrate my projects to visual studio because of superior features, but this detail is currently putting me off.
My question is: Is there a way to configure visual studio so it achieves a similar behavior as Clion? If not, is this going to be a planned feature?