Add DISABLE_GIT_DETECTION CMake option

Pull for #1486