We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e090cd commit 31c48a0Copy full SHA for 31c48a0
CMakeLists.txt
@@ -48,8 +48,9 @@ string(REGEX REPLACE "^[^.]*\\.[^.]*\\.([0-9]*).*" "\\1" VERSION_PATCH ${VERSION
48
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
49
execute_process(COMMAND git describe --abbrev=4
50
OUTPUT_VARIABLE GIT_REV)
51
- string(REGEX REPLACE "\n$" "" PACKAGE_VERSION "${GIT_REV}")
52
-else()
+ string(REGEX REPLACE "\n$" "" PACKAGE_VERSION "${GIT_REV}")
+endif()
53
+if(NOT EXISTS ${PACKAGE_VERSION})
54
set(PACKAGE_VERSION ${VERSION_PLAIN})
55
endif()
56
0 commit comments