From ae238c629b4f0c2f6a72b36e20ba02e358d1520b Mon Sep 17 00:00:00 2001 From: Bertrand Bellenot Date: Tue, 13 Aug 2024 14:50:15 +0200 Subject: [PATCH] [cmake] Avoid warning when building from tar file Use the ROOT version from file when building from the source tar file Fixes https://github.com/root-project/root/issues/15178 --- cmake/modules/SetROOTVersion.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/modules/SetROOTVersion.cmake b/cmake/modules/SetROOTVersion.cmake index d37b9150f04bc..fe14f287e5195 100644 --- a/cmake/modules/SetROOTVersion.cmake +++ b/cmake/modules/SetROOTVersion.cmake @@ -82,7 +82,9 @@ function(SET_ROOT_VERSION) if (${GIT_DESCRIBE_ALL} MATCHES "^tags/") string(REGEX REPLACE "^tags/" "" GIT_DESCRIBE_ALWAYS ${GIT_DESCRIBE_ALL}) else() - message(WARNING "GIT_DESCRIBE_ALL is `${GIT_DESCRIBE_ALL}` with a format unexpected for tags. Not setting the commit.") + set(ROOT_GIT_VERSION "${ROOT_MAJOR_VERSION}-${ROOT_MINOR_VERSION}-${ROOT_PATCH_VERSION}") + set(GIT_DESCRIBE_ALL "tags/${ROOT_GIT_VERSION}") + set(GIT_DESCRIBE_ALWAYS ${ROOT_GIT_VERSION}) endif() endif()