Skip to content

Commit

Permalink
Fix git version mismatch logic with shallow clones
Browse files Browse the repository at this point in the history
  • Loading branch information
daljit46 committed Sep 18, 2024
1 parent d753881 commit d3bb3a1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmake/FindVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ if(EXISTS ${ROOT_DIR}/.git)
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(NOT "${MRTRIX_GIT_TAG}" STREQUAL ${MRTRIX_BASE_VERSION})
message(FATAL_ERROR "MRtrix3 base version does not match the git tag!")
endif()

if(NOT MRTRIX_GIT_TAG_ERROR AND NOT MRTRIX_GIT_COMMIT_ERROR)
message(VERBOSE "Git tag: ${MRTRIX_GIT_TAG}; Git commit: ${MRTRIX_GIT_COMMIT}")
if(NOT "${MRTRIX_GIT_TAG}" STREQUAL ${MRTRIX_BASE_VERSION})
message(FATAL_ERROR "MRtrix3 base version does not match the git tag!")
endif()
set(MRTRIX_VERSION ${MRTRIX_GIT_COMMIT})
else()
message(WARNING "Git tag: not found.")
message(WARNING "Failed to get git tag and commit. Version will be set to default base version.")
endif()
else()
message(WARNING "Git not found on this system. Version will be set to default base version.")
Expand Down

0 comments on commit d3bb3a1

Please sign in to comment.