Skip to content

Commit

Permalink
Merge pull request #254 from LLNL/bugfix/add_banner_hash
Browse files Browse the repository at this point in the history
Always include the git hash in the Spheral python banner
  • Loading branch information
ldowen authored Jan 18, 2024
2 parents ab6e037 + b30b4fb commit 04b32f2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/SimulationControl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
set(spheralversion "v${CMAKE_PROJECT_VERSION}")
if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git describe --tags
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git describe --tags --abbrev=0
OUTPUT_VARIABLE tagcomm
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "-" " " tagcomm "${tagcomm}")

execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git rev-parse --short HEAD
OUTPUT_VARIABLE githash
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE abbref
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(SPHERAL_VERSION_LIST ${tagcomm} ${abbref})
set(SPHERAL_VERSION_LIST ${tagcomm} ${githash} ${abbref})
string(REPLACE ";" " " spheralversion "${SPHERAL_VERSION_LIST}")
endif()
configure_file(
Expand Down

0 comments on commit 04b32f2

Please sign in to comment.