If git information is not available try ${CMAKE_SOURCE_DIR}/GIT_VERSION
This file can be created by scripts while preparing tarballs and is supposed to contain two lines: hash and branch
(port from kexi.git)