[cmake] Fix getting version info from tags during the build (#6936)

Use `git describe --tags` to query for lightweight tags along with
the annotated ones.
This commit is contained in:
Denis Protivensky
2021-11-22 22:53:50 +03:00
committed by GitHub
parent e89de4411d
commit 790f411542

View File

@@ -6,7 +6,7 @@ set(VERSION_COMMIT 0)
find_program(GIT git)
if(GIT)
execute_process(
COMMAND ${GIT} describe
COMMAND ${GIT} describe --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE_DIRTY
OUTPUT_STRIP_TRAILING_WHITESPACE