Skip to content

Commit

Permalink
ci: fix master version generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jahnf committed Oct 13, 2023
1 parent 372f5e8 commit f7c6f1d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmake/modules/GitVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,18 @@ function(get_version_info prefix directory)
if(NOT ${${prefix}_VERSION_PATCH} EQUAL 0)
set(VERSION_STRING "${VERSION_STRING}.${${prefix}_VERSION_PATCH}")
endif()
if(NOT ON_MASTER OR NOT ${${prefix}_VERSION_DISTANCE} EQUAL 0)
if(NOT ON_MASTER OR NOT ${${prefix}_VERSION_DISTANCE} EQUAL ${${prefix}_VERSION_DISTANCE_OFFSET})
set(VERSION_STRING "${VERSION_STRING}-${${prefix}_VERSION_FLAG}")
set(VERSION_STRING_FULL "${VERSION_STRING_FULL}-${${prefix}_VERSION_FLAG}")
endif()
if(NOT ${${prefix}_VERSION_FLAG} STREQUAL "")
set(VERSION_STRING "${VERSION_STRING}.")
set(VERSION_STRING_FULL "${VERSION_STRING_FULL}.")
endif()
if(NOT ON_MASTER OR (NOT ON_MASTER AND NOT ${${prefix}_VERSION_DISTANCE} EQUAL 0))
if(NOT ON_MASTER OR (NOT ON_MASTER AND NOT ${${prefix}_VERSION_DISTANCE} EQUAL ${${prefix}_VERSION_DISTANCE_OFFSET}))
set(VERSION_STRING "${VERSION_STRING}${${prefix}_VERSION_DISTANCE}")
set(VERSION_STRING_FULL "${VERSION_STRING_FULL}${${prefix}_VERSION_DISTANCE}")
elseif(ON_MASTER AND NOT ${${prefix}_VERSION_DISTANCE} EQUAL ${${prefix}_VERSION_DISTANCE_OFFSET})
set(VERSION_STRING "${VERSION_STRING}${${prefix}_VERSION_DISTANCE}")
set(VERSION_STRING_FULL "${VERSION_STRING_FULL}${${prefix}_VERSION_DISTANCE}")
endif()
Expand Down Expand Up @@ -390,7 +393,7 @@ function(add_version_info_custom_prefix target prefix directory)
set(VERSION_DISTANCE_OFFSET ${TARGET_VDIST_OFFSET})
endif()
set(${prefix}_VERSION_DISTANCE_OFFSET ${VERSION_DISTANCE_OFFSET})

include(ArchiveVersionInfo_${prefix} OPTIONAL RESULT_VARIABLE ARCHIVE_VERSION_PRESENT)
if(ARCHIVE_VERSION_PRESENT AND ${prefix}_VERSION_SUCCESS)
message(STATUS "Info: Version information from archive file.")
Expand Down

0 comments on commit f7c6f1d

Please sign in to comment.