Skip to content

Commit

Permalink
Use the date in GitHub snapshots
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Dec 4, 2024
1 parent 6694257 commit 77a1bdd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/DetermineVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ function(determine_version source_dir git_command var_prefix)
set (${var_prefix}_VERSION_IS_RELEASE FALSE PARENT_SCOPE)
endif()
else()
# snapshot, so use the date
string(TIMESTAMP date "%Y%m%d" UTC)
set (patch_extra "${date}")
set (${var_prefix}_VERSION_PATCH_EXTRA ${patch_extra} PARENT_SCOPE)
set (${var_prefix}_VERSION "${${var_prefix}_VERSION_MAJOR}.${${var_prefix}_VERSION_MINOR}.${${var_prefix}_VERSION_PATCH}-${patch_extra}" PARENT_SCOPE)
message(STATUS
"Could not use git to determine source version, using version ${${var_prefix}_VERSION}"
)
endif()
endfunction()
endfunction()

0 comments on commit 77a1bdd

Please sign in to comment.