Skip to content

Commit

Permalink
CMake: Swap commit and branch in version
Browse files Browse the repository at this point in the history
  • Loading branch information
tmp64 committed Sep 29, 2024
1 parent 00720f7 commit 09212fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmake/GitVersionSemverfier.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
if(GIT_SKIP GREATER 0)
math(EXPR GIT_MINOR "${GIT_MINOR} + 1" OUTPUT_FORMAT DECIMAL)
string(REGEX REPLACE "(v[0-9]+\.)([0-9]+)(\.[0-9]+)(.*)" "\\1${GIT_MINOR}.0\\4" GIT_TAG "${GIT_TAG}")
set(GIT_SEM_VERSION "${GIT_TAG}${_git_delimiter}dev.${GIT_SKIP}+${GIT_HASH}.${GIT_BRANCH}")
set(GIT_SEM_VERSION "${GIT_TAG}${_git_delimiter}dev.${GIT_SKIP}+${GIT_BRANCH}.${GIT_HASH}")
set(GIT_PATCH 0)
else()
set(GIT_SEM_VERSION "${GIT_TAG}+${GIT_HASH}.${GIT_BRANCH}")
set(GIT_SEM_VERSION "${GIT_TAG}+${GIT_BRANCH}.${GIT_HASH}")
endif()

execute_process(COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
Expand Down Expand Up @@ -99,6 +99,6 @@ else()
set(GIT_PATCH 0)
set(GIT_SKIP 0)
set(GIT_TAG "v0.0.0")
set(GIT_SEM_VERSION "0.0.0+0000000.error")
set(GIT_SEM_VERSION "0.0.0+error.0000000")
set(GIT_SUCCESS FALSE)
endif()

0 comments on commit 09212fb

Please sign in to comment.