Fix build when .git is a gitlink file
authorChad Versace <chadversary@google.com>
Fri, 3 Nov 2017 16:36:30 +0000 (09:36 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 4 Dec 2017 11:20:39 +0000 (06:20 -0500)
commitb5cd0ad3079ea00f0d4b243280430a36594eaae4
treea43556810f36cc10bac29c26072e11b27b5b388d
parent6c3fca93367fd97c4eb9e7b2a4e642c1284e3ff9
Fix build when .git is a gitlink file

If ${CMAKE_SOURCE_DIR}/.git exists, then
framework/qphelper/CMakeLists.txt uses the git revision as the dEQP
revision. The CMake rules update the revision when the files
${CMAKE_SOURCE_DIR}/.git/HEAD and ${CMAKE_SOURCE_DIR}/.git/index
change.

However, Git does not require that .git be a directory. If
git-submodules or git-worktrees are used, then .git may be a gitlink
file instead and the real git directory is elsewhere.

Fix the build by using `git rev-parse --git-dir` to find the real git dir
and `git rev-parse HEAD` to query the commit sha1.

This bumps the CMake requirement from 2.8 to 2.8.2. But that should be
safe since 2.8.2 was released in 2010.

Components: Framework
Change-Id: I811630e5afada8e6aed611b0ef6c51e39be2200b
CMakeLists.txt
framework/qphelper/CMakeLists.txt
framework/qphelper/gen_release_info.py