From 34e23f7187cdd33e56f90ee730999ee2ce26a7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Thu, 4 Aug 2022 15:47:04 +0200 Subject: [PATCH] cmake: use version from text file without suffix --- version.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/version.cmake b/version.cmake index f74126e..5ab38da 100644 --- a/version.cmake +++ b/version.cmake @@ -138,11 +138,12 @@ function(determine_version source_dir var_prefix) # | exact tag | 0.9.0 | # | exact tag, dirty | 0.9.0+git20180604 | # | after tag | 0.9.0+git20180604.1.085039f | - # | no tag, version.txt | 0.9.0+git20180604.2ee02af | + # | no tag, version.txt | 0.9.0 | # | no tag, no version.txt| 0.0.0+git20180604.2ee02af | string(TIMESTAMP date "%Y%m%d" UTC) set(version_suffix "") - if (NOT ${local_prefix}_VERSION_NCOMMITS EQUAL 0) + if (has_version_txt) + elseif (NOT ${local_prefix}_VERSION_NCOMMITS EQUAL 0) # 0.9.0+git20150604.4.289818b string(APPEND version_suffix "+git${date}.${${local_prefix}_VERSION_NCOMMITS}.${${local_prefix}_VERSION_GIT_REV}") elseif ((NOT has_release_tag) AND ((NOT has_version_txt) OR ("${base_version}" STREQUAL "0.0.0") OR (NOT "${revision}" STREQUAL "")))