cmake: Find the default generator only when printing the generator list
`cmake --version` and the other documentation options build the
generator documentation even when they do not print it. That evaluates
the default generator, which on Windows queries the Visual Studio Setup
COM API for VS 18, 17, 16 and 15 in turn and constructs the newest
Visual Studio generator found. It makes `cmake --version` take about
100 ms on Windows, which is a lot for a command that tools run often
to detect CMake.
Only `--help` and the generator listing print generators. Evaluate them
only for those requests.
Fixes: #28220
5 files changed