Get complete list of target's source files

I’m using Qt’s CMake commands to define my targets. Under the hood, due to how Qt builds its source files, the generated project ends up with many dynamically added files. When the Xcode project is generated, these files are added to the top level of the target which is rather annoying.

I know that there is the source_group command, but I cannot find a way to get the complete list of target’s files: these dynamic files are not listed in any of the target’s properties.

CMake won’t be able to know their paths to mention in the Xcode project either. It’s something that would need to be known at configure time, I believe, to do correctly today.