Disconnect between FILE_SET and source_group

I find it strange that there are two abstractions introduced to group source files for two different purposes and they can’t interact in any way. Still the best way to use file sets and source groups is to define them in an auxiliary variable and expand them in the appropriate contexts which seems silly. Once a file set is created, can’t we use them in a source group? Or why are file sets so limited?

Am I the only one feeling that there is room for a simplification / merge of these two concepts? Starting with the fact that beside the HEADER set type, SOURCE is immediately a glaring absence.

Thanks for pointing this out. source_group is only about presentation in IDEs, while FILE_SETs have semantic meaning in the code model. The two features were designed for different purposes at different times and indeed no overlap has been considered. We could probably teach source_group to attach an entire file set to a group without naming the individual members. I’d welcome design proposals for that.

I totally agree with @MathiasMagnus.

I’m not a developer of CMake, so I won’t propose anything, but I note there isn’t any issue on Gitlab about this need. Should I create one ?

I opened CMake Issue 25992 for this, thanks.