I read the documentation.
It says:
A CMake Generator is responsible for writing the input files for a native build system.
What ex
A CMake Generator is responsible for writing the input files for a native build system.
means that CMake prepares build scripts for a native build system when no generator is specified. In Linux the default build system is Make and its input file are makefiles, which are then interpreted and a build is executed accordingly. Before the first execution of CMake build scripts do not exist.
C++ source files (or any other source files) are not input files to a build system. Build system scripts specify how to handle source file in order to produce binary executables.