Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-annotated tags from git for setting version #1576

Merged
merged 1 commit into from
Oct 15, 2023
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