If the build is from a non-repository, these functions will return empty. This patch allows using defines to CMake to set version info such as -DGIT_BRANCH=master.