From ba1c32981d4fadb6375a5c7c84f5aedfa3c393b6 Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Mon, 1 Jun 2026 14:43:51 +0700 Subject: [PATCH] Use DEFAULT_VERSION in get_git_version() When building from a source tarball (no .git directory), the version cannot be determined from git tags. Pass DEFAULT_VERSION so that the version can be set via -DPROJECT_VERSION on the CMake command line. The get_git_version() function already supports this parameter; this change simply makes use of it. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0597d85..4911618 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) include(FairLoggerLib) include(FairFindPackage2) -get_git_version() +get_git_version(DEFAULT_VERSION ${PROJECT_VERSION}) project(FairLogger VERSION ${PROJECT_VERSION} LANGUAGES CXX) message(STATUS "${BWhite}${PROJECT_NAME}${CR} ${PROJECT_GIT_VERSION} from ${PROJECT_DATE}")