As described on the CMake website, "CMake is an open-source, cross-platform family of tools designed to build, test and package software".
To compile a source directory containing a valid CMakeLists.txt file, create and navigate into a dedicated build directory (which may be named build, for example). Run the following command to generate a build system for the current project:
cmake path/to/src
Run the following command to build a CMake-generated project binary tree:
cmake --build .
The resulting executable should be found in the make directory or a Debug or Release build configuration subdirectory.
The source code for CMake is available on Gitlab.
CMake also includes an official tutorial, for which the source code is available in the Help/guide/tutorial directory of the CMake Gitlab repository.
The CMake documentation contains pages on cmake-commands (EG add_executable, target_include_directories, etc.) and cmake-variables (EG CMAKE_CXX_STANDARD, PROJECT_BINARY_DIR, etc.), among other features.