Fix build error when building from a tarball instead of a git clone

This commit is contained in:
Guillaume Meunier
2023-07-29 17:50:51 +02:00
parent cef644e5da
commit 8de6b2283d
4 changed files with 12 additions and 4 deletions
+7 -2
View File
@@ -1,5 +1,10 @@
execute_process(COMMAND git describe --always OUTPUT_VARIABLE GIT_DESC)
string(STRIP ${GIT_DESC} GIT_DESC)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always OUTPUT_VARIABLE GIT_DESC ERROR_QUIET)
if (GIT_DESC)
string(STRIP ${GIT_DESC} GIT_DESC)
else()
set(GIT_DESC v${CMAKE_PROJECT_VERSION})
endif()
configure_file(${INPUT_FILE} ${OUTPUT_FILE})