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.
This commit is contained in:
Oliver Lantwin
2026-06-01 14:43:51 +07:00
committed by Alexey Rybalchenko
parent 5aee7970fb
commit 5444de4539

View File

@@ -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}")