Recently, I wanted to understand what was occuring in some CMake script run by LLVM's CMake build system.
It runs at build time via add_custom_command, invoking CMake in script mode (-P). I was trying to find out
what happens in the script when ${llvm_source_dir} is empty. The internal details of GenerateVersionFromVCS
were a bit hard to follow.
set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSRevision.h")
set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")