From 81ceb3cb8d524969ccca09e53206a257dfc69fba Mon Sep 17 00:00:00 2001 From: Jackarain Date: Wed, 5 Jun 2024 11:03:52 +0800 Subject: [PATCH] Update cmake for git version --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e95eb2510..89a20631c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,11 @@ if (ENABLE_GIT_VERSION) find_package(Git) gitGetVersion(${CMAKE_CURRENT_SOURCE_DIR} proxy) set(VERSION_GIT ${proxy_WC_REVISION_HASH}) - string(TIMESTAMP PVERSION "${VERSION_GIT} (%Y-%m-%d %H:%M:%S)") + if (${VERSION_GIT} STREQUAL "") + string(TIMESTAMP PVERSION "(%Y-%m-%d %H:%M:%S)") + else() + string(TIMESTAMP PVERSION "${VERSION_GIT} (%Y-%m-%d %H:%M:%S)") + endif() message(STATUS "Git Version: ${PVERSION}") endif()