Support git/version info in templates.

Also warn if the build is made from a non-committed state in CMake.