Skip to content
Snippets Groups Projects
Commit 2066ec75 authored by Eoin Clerkin's avatar Eoin Clerkin Committed by Florian Uhlig
Browse files

build hash record and report

Record the hash and date of the build and report these at build and configuration times.
parent e6b096cb
No related branches found
No related tags found
1 merge request!1029build hash record and report
Pipeline #21482 passed
...@@ -30,6 +30,18 @@ set(CBMROOT_MAJOR_VERSION 22) ...@@ -30,6 +30,18 @@ set(CBMROOT_MAJOR_VERSION 22)
set(CBMROOT_MINOR_VERSION 2) set(CBMROOT_MINOR_VERSION 2)
set(CBMROOT_PATCH_VERSION 99) set(CBMROOT_PATCH_VERSION 99)
execute_process(
COMMAND bash "-c" "cd ${CMAKE_SOURCE_DIR} && git log | head -n 1 | sed 's_commit \\(.[^ ]*\\)_\\1_' && cd ${OLDPWD}"
OUTPUT_VARIABLE CBMROOT_BUILD_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND bash "-c" "cd ${CMAKE_SOURCE_DIR} && git log | sed -n '3 s/Date:[ ]*//p' && cd ${OLDPWD}"
OUTPUT_VARIABLE CBMROOT_BUILD_HASH_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
message("CBMROOT BUILD HASH is ${CBMROOT_BUILD_HASH} dated on ${CBMROOT_BUILD_HASH_DATE}.")
# Set name of our project to "CBMROOT" # Set name of our project to "CBMROOT"
# This also sets ${CBMROOT_VERSION} to the provided VERSION value, which would be empty if not set here explicitly # This also sets ${CBMROOT_VERSION} to the provided VERSION value, which would be empty if not set here explicitly
project(CBMROOT project(CBMROOT
......
...@@ -58,5 +58,5 @@ if [ $same_system -eq 1 ]; then ...@@ -58,5 +58,5 @@ if [ $same_system -eq 1 ]; then
export PATH=$PATH:"@MY_PATH@" export PATH=$PATH:"@MY_PATH@"
;; ;;
esac esac
echo "Configurated for CBMROOT at ${VMCWORKDIR}" echo "Configured CBMROOT build @CBMROOT_BUILD_HASH@ (@CBMROOT_BUILD_HASH_DATE@)"
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment