这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions buildsystem/DetectProjectVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()
if(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/.git")
message(STATUS "Set PROJECT_VERSION from git.")
execute_process(
COMMAND git describe
COMMAND git describe --tags
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE _RES
OUTPUT_VARIABLE PROJECT_VERSION
Expand All @@ -30,8 +30,8 @@ set(PROJECT_VERSION_FILE "${CMAKE_SOURCE_DIR}/openage_version")
if(EXISTS ${PROJECT_VERSION_FILE})
file(STRINGS ${PROJECT_VERSION_FILE} FILE_DESCRIBE_VERSION)

STRING(REGEX REPLACE "v([0-9]+\\.[0-9]+\\.[0-9]+)"
"\\1" PROJECT_VERSION "${FILE_DESCRIBE_VERSION}")
STRING(REGEX REPLACE "([0-9]+\\.[0-9]+\\.[0-9]+)"
"\\1" PROJECT_VERSION "${FILE_DESCRIBE_VERSION}")
endif()

# Still could not detect the version. Don't worry, raise a warning (shout a curse word?) and move on.
Expand Down