This commit is contained in:
朱子楚\zhuzi 2023-08-23 20:54:19 +08:00
parent 7fec01c2a4
commit cb34c9e48d

View File

@ -299,12 +299,12 @@ git_describe(GIT_DESCRIBE)
git_commit_counts(GIT_COMMIT_COUNT) git_commit_counts(GIT_COMMIT_COUNT)
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR) _git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
if(NOT IS_DIRECTORY ${GIT_DIR}) if(NOT IS_DIRECTORY ${GIT_DIR})
message(".git not exist") message(STATUS "Current .git not exist")
set(GIT_COMMIT_COUNT "1") set(GIT_COMMIT_COUNT "1")
set(GIT_DESCRIBE "1.0.0") set(GIT_DESCRIBE "1.0.0")
set(GIT_TAG "1.0.0") set(GIT_TAG "1.0.0")
else() else()
message(".git exist") message(STATUS "Current .git exist")
endif() endif()
string(REPLACE "." "," GIT_TAG_WITH_COMMA ${GIT_TAG}) string(REPLACE "." "," GIT_TAG_WITH_COMMA ${GIT_TAG})
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" GIT_SEMVER "${GIT_TAG}") string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" GIT_SEMVER "${GIT_TAG}")