From 77a1bdd9108329df075f5d61fe01f63653e39047 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Wed, 4 Dec 2024 13:37:43 -0500 Subject: [PATCH] Use the date in GitHub snapshots Signed-off-by: Geoff Hutchison --- cmake/DetermineVersion.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/DetermineVersion.cmake b/cmake/DetermineVersion.cmake index b5a87206..fd8a88b9 100644 --- a/cmake/DetermineVersion.cmake +++ b/cmake/DetermineVersion.cmake @@ -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() \ No newline at end of file +endfunction()