cmGlobalGenerator: Only compute build files for all targets

If we're creating generation objects for imported targets only, we
don't need the export sets. Only compute build file generators
if generating for all targets.

Fixes: #23709
3 files changed