Adding a new file to an existing source_group

I have a fairly large project which is structured in such a way that, after a large number of files have been generated, they are placed into a special ‘Generated’ folder within my Visual Studio project:

             PREFIX "Generated"

Much later in the project, after having gathered some other information which wasn’t available when the first files were generated, I generate one more file and I’d like to add it to the same Visual Studio project folder as the ones I generated earlier.

I can’t figure out a way of doing this. If I use the alternative syntax for the source_group command, viz.

                       FILES ${extraFile})

…then the new file is placed exactly where I want it to be, but all the ones that were there before get removed from the folder.

It looks that the two ways of using source_group are mutually incompatible. Is that the case, or is there a way of doing this?

[I know that there is a workaround of retaining the list of files that I had when I executed the first source_group command, and then doing a single invocation of source_group using the ‘TREE’ syntax after the extra file has been generated. That would need quite a lot of refactoring, though, so I’d rather avoid it if there’s a simpler way.]

I was slow on the uptake, but all I actually had to do was to add the extra file in a repeat of the original declaration, viz.

                 PREFIX "Generated"
                 FILES ${extraFile})

…and that did exactly what I needed.