Commit hash is stored in an automatically generated header file.

A file called BuildInfo.h is automatically generated in the build directory root when cmake is run which contains the commit hash.