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

Add support for stable releases #1286

Merged
merged 3 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 19 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,25 @@ include(cmake/FreecivBuildOptions.cmake)
include(AutoRevision)

# Set some variables from AutoRevision for use here and later
list(GET FC21_REV_TAG_LIST 0 FC21_MAJOR_VERSION)
list(GET FC21_REV_TAG_LIST 1 FC21_MINOR_VERSION)
list(GET FC21_REV_TAG_LIST 2 FC21_LABEL_VERSION)
list(GET FC21_REV_TAG_LIST 3 FC21_EMER_VERSION)
set(FC21_PATCH_VERSION ${FC21_REV_HEAD_HASH_D})

# Set some project variables to reuse later
set(FREECIV21_VERSION_MAJOR ${FC21_MAJOR_VERSION})
set(FREECIV21_VERSION_MINOR ${FC21_MINOR_VERSION})
set(FREECIV21_VERSION_PATCH ${FC21_PATCH_VERSION})
set(FREECIV21_VERSION "${FREECIV21_VERSION_MAJOR}.${FREECIV21_VERSION_MINOR}.${FREECIV21_VERSION_PATCH}")
list(LENGTH FC21_REV_TAG_LIST FC21_REV_TAG_LIST_LENGTH)

# When we tag a stable release we only get 2 of the 4 components populated
# So we manually set some of the variables we need for the full version.
if(${FC21_REV_TAG_LIST_LENGTH} EQUAL 2)
list(GET FC21_REV_TAG_LIST 0 FC21_MAJOR_VERSION)
list(GET FC21_REV_TAG_LIST 1 FC21_MINOR_VERSION)
set(FC21_LABEL_VERSION "Stable")
set(FC21_EMER_VERSION "0")
set(FC21_PATCH_VERSION "0")
else()
list(GET FC21_REV_TAG_LIST 0 FC21_MAJOR_VERSION)
list(GET FC21_REV_TAG_LIST 1 FC21_MINOR_VERSION)
list(GET FC21_REV_TAG_LIST 2 FC21_LABEL_VERSION)
list(GET FC21_REV_TAG_LIST 3 FC21_EMER_VERSION)
set(FC21_PATCH_VERSION ${FC21_REV_HEAD_HASH_D})
endif()

set(FREECIV21_VERSION "${FC21_MAJOR_VERSION}.${FC21_MINOR_VERSION}.${FC21_PATCH_VERSION}")

# Set project
project(freeciv21 VERSION ${FREECIV21_VERSION} LANGUAGES C CXX)
Expand Down
6 changes: 3 additions & 3 deletions cmake/CPackConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
set(CPACK_PACKAGE_NAME "Freeciv21")
set(CPACK_PACKAGE_VENDOR "longturn.net")
set(CPACK_PACKAGE_CONTACT "longturn.net")
set(CPACK_PACKAGE_VERSION_MAJOR ${FREECIV21_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${FREECIV21_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${FREECIV21_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION_MAJOR ${FC21_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${FC21_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${FC21_PATCH_VERSION})
set(CPACK_PACKAGE_VERSION ${FREECIV21_VERSION})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Freeciv21 - Freeciv for the 21st Century")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://longturn.net")
Expand Down