You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building libnitrokey with -DADD_GIT_INFO=OFF causes it to fallback to the project version specified in the CMakeLists.txt. Apparently this version was not incremented for the 3.8 release and later, i.e. it is still displayed as version 3.7.0 in nitrokey-app, some log output etc.
I also patch it to allow setting PROJECT_VERSION_GIT as cmake cache variable from CLI, '-DPROJECT_VERSION_GIT="v3.8-10-ge4b2b91' as I build from a source snapshot with no git available during build.
This patch doesn't change any behavior if PROJECT_VERSION_GIT is not set in cache so I think it could be applied upstream.
From 3d58ea51b9922d529c6402c5cd10849c0b8f6ba3 Mon Sep 17 00:00:00 2001
From: Jernej Jakob <[email protected]>
Date: Sun, 14 May 2023 23:52:11 +0200
Subject: [PATCH 1/2] CMakeLists.txt: allow setting PROJECT_VERSION_GIT from
CLI
---
CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 246923d..b604b8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -142,7 +142,10 @@ ENDIF()
# 2. If git is not installed, PROJECT_VERSION_GIT_RETURN_CODE
# will contain the string 'No such file or directory'
# Hence fallback to PROJECT_VERSION when the return code is NOT 0.
-IF((NOT ${ADD_GIT_INFO}) OR (NOT ${PROJECT_VERSION_GIT_RETURN_CODE} STREQUAL "0"))
+IF(((NOT ${ADD_GIT_INFO})
+ OR (NOT ${PROJECT_VERSION_GIT_RETURN_CODE} STREQUAL "0")
+ )
+ AND (NOT PROJECT_VERSION_GIT))
MESSAGE(STATUS "Setting fallback Git library version")
SET(PROJECT_VERSION_GIT "v${PROJECT_VERSION}")
ENDIF()
--
2.39.3
Building libnitrokey with
-DADD_GIT_INFO=OFF
causes it to fallback to the project version specified in the CMakeLists.txt. Apparently this version was not incremented for the 3.8 release and later, i.e. it is still displayed as version 3.7.0 in nitrokey-app, some log output etc.libnitrokey/CMakeLists.txt
Line 24 in 9fbaaa9
The text was updated successfully, but these errors were encountered: