Skip to content

Commit

Permalink
CMake: Fix version when tag is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
tmp64 committed Aug 25, 2024
1 parent 790c840 commit 15bf415
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@ else()
set(GIT_MINOR ${BHL_REPO_VERSION_MINOR})
set(GIT_PATCH ${BHL_REPO_VERSION_PATCH})
set(GIT_SKIP 0)
set(GIT_TAG "v${GIT_MAJOR}.${GIT_MINOR}.${GIT_PATCH}-${BHL_REPO_VERSION_TAG}")
set(GIT_SEM_VERSION "${GIT_MAJOR}.${GIT_MINOR}.${GIT_PATCH}-${BHL_REPO_VERSION_TAG}+no-git")

if( BHL_REPO_VERSION_TAG STREQUAL "" )
set(GIT_TAG "v${GIT_MAJOR}.${GIT_MINOR}.${GIT_PATCH}")
set(GIT_SEM_VERSION "${GIT_MAJOR}.${GIT_MINOR}.${GIT_PATCH}+no-git")
else()
set(GIT_TAG "v${GIT_MAJOR}.${GIT_MINOR}.${GIT_PATCH}-${BHL_REPO_VERSION_TAG}")
set(GIT_SEM_VERSION "${GIT_MAJOR}.${GIT_MINOR}.${GIT_PATCH}-${BHL_REPO_VERSION_TAG}+no-git")
endif()

message( "Version: ${GIT_SEM_VERSION} (from repo)" )
endif()

Expand Down

0 comments on commit 15bf415

Please sign in to comment.