From cf6fd9f57a1f872b4d991d44dcd67915d498ffbd Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Thu, 28 May 2015 12:13:15 -0400 Subject: [PATCH] testHarness: adding git revision number to buildName --- CMakeLists.txt | 8 ++++++++ testHarness/foam-extend/3.1/CMakeFiles/CMakeLists.txt | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc6fe1b9e..019caf65c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,13 @@ if(GIT_FOUND) OUTPUT_VARIABLE GIT_BRANCH_NAME ) message("Git branch: ${GIT_BRANCH_NAME}") + + # We also add the git rev number to the build name + EXEC_PROGRAM(git + ARGS rev-parse --short=12 HEAD + OUTPUT_VARIABLE GIT_REV_NUMBER + ) + message("Git rev: ${GIT_REV_NUMBER}") if (GIT_BRANCH_NAME STREQUAL "") message("No git-branch. Mercurial?") EXEC_PROGRAM(hg @@ -136,6 +143,7 @@ if(GIT_FOUND) message("Git branch (mercurial): ${GIT_BRANCH_NAME}") endif() SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") + SET(BUILDNAME "${BUILDNAME}-git-rev=${GIT_REV_NUMBER}") endif() # Some last minute cleanup diff --git a/testHarness/foam-extend/3.1/CMakeFiles/CMakeLists.txt b/testHarness/foam-extend/3.1/CMakeFiles/CMakeLists.txt index dc6fe1b9e..019caf65c 100644 --- a/testHarness/foam-extend/3.1/CMakeFiles/CMakeLists.txt +++ b/testHarness/foam-extend/3.1/CMakeFiles/CMakeLists.txt @@ -124,6 +124,13 @@ if(GIT_FOUND) OUTPUT_VARIABLE GIT_BRANCH_NAME ) message("Git branch: ${GIT_BRANCH_NAME}") + + # We also add the git rev number to the build name + EXEC_PROGRAM(git + ARGS rev-parse --short=12 HEAD + OUTPUT_VARIABLE GIT_REV_NUMBER + ) + message("Git rev: ${GIT_REV_NUMBER}") if (GIT_BRANCH_NAME STREQUAL "") message("No git-branch. Mercurial?") EXEC_PROGRAM(hg @@ -136,6 +143,7 @@ if(GIT_FOUND) message("Git branch (mercurial): ${GIT_BRANCH_NAME}") endif() SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") + SET(BUILDNAME "${BUILDNAME}-git-rev=${GIT_REV_NUMBER}") endif() # Some last minute cleanup