mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 20:37:45 +00:00
feat(build): Set correct year in VER_LEGALCOPYRIGHT_STR (#6488)
* cherry-pick commit (68a490923d)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -20,6 +20,8 @@ if(WITHOUT_GIT)
|
|||||||
set(rev_date "1970-01-01 00:00:00 +0000")
|
set(rev_date "1970-01-01 00:00:00 +0000")
|
||||||
set(rev_hash "unknown")
|
set(rev_hash "unknown")
|
||||||
set(rev_branch "Archived")
|
set(rev_branch "Archived")
|
||||||
|
# No valid git commit date, use today
|
||||||
|
string(TIMESTAMP rev_date_fallback "%Y-%m-%d %H:%M:%S" UTC)
|
||||||
else()
|
else()
|
||||||
# Workaround for not correctly detecting git
|
# Workaround for not correctly detecting git
|
||||||
if (NOT GIT_EXECUTABLE)
|
if (NOT GIT_EXECUTABLE)
|
||||||
@@ -65,12 +67,22 @@ else()
|
|||||||
set(rev_date "1970-01-01 00:00:00 +0000")
|
set(rev_date "1970-01-01 00:00:00 +0000")
|
||||||
set(rev_hash "unknown")
|
set(rev_hash "unknown")
|
||||||
set(rev_branch "Archived")
|
set(rev_branch "Archived")
|
||||||
|
# No valid git commit date, use today
|
||||||
|
string(TIMESTAMP rev_date_fallback "%Y-%m-%d %H:%M:%S" UTC)
|
||||||
else()
|
else()
|
||||||
|
# We have valid date from git commit, use that
|
||||||
|
set(rev_date_fallback ${rev_date})
|
||||||
# Extract information required to build a proper versionstring
|
# Extract information required to build a proper versionstring
|
||||||
string(REGEX REPLACE 0.1-|[0-9]+-g "" rev_hash ${rev_info})
|
string(REGEX REPLACE 0.1-|[0-9]+-g "" rev_hash ${rev_info})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# For package/copyright information we always need a proper date - keep "Archived/1970" for displaying git info but a valid year elsewhere
|
||||||
|
string(REGEX MATCH "([0-9]+)-([0-9]+)-([0-9]+)" rev_date_fallback_match ${rev_date_fallback})
|
||||||
|
set(rev_year ${CMAKE_MATCH_1})
|
||||||
|
set(rev_month ${CMAKE_MATCH_2})
|
||||||
|
set(rev_day ${CMAKE_MATCH_3})
|
||||||
|
|
||||||
# Create the actual revision.h file from the above params
|
# Create the actual revision.h file from the above params
|
||||||
if(NOT "${rev_hash_cached}" STREQUAL "${rev_hash}" OR NOT "${rev_branch_cached}" STREQUAL "${rev_branch}" OR NOT EXISTS "${BUILDDIR}/revision.h")
|
if(NOT "${rev_hash_cached}" STREQUAL "${rev_hash}" OR NOT "${rev_branch_cached}" STREQUAL "${rev_branch}" OR NOT EXISTS "${BUILDDIR}/revision.h")
|
||||||
configure_file(
|
configure_file(
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define _CMAKE_VERSION R"(@CMAKE_VERSION@)"
|
#define _CMAKE_VERSION R"(@CMAKE_VERSION@)"
|
||||||
#define _CMAKE_HOST_SYSTEM R"(@CMAKE_HOST_SYSTEM_NAME@ @CMAKE_HOST_SYSTEM_VERSION@)"
|
#define _CMAKE_HOST_SYSTEM R"(@CMAKE_HOST_SYSTEM_NAME@ @CMAKE_HOST_SYSTEM_VERSION@)"
|
||||||
#define VER_COMPANYNAME_STR "AzerothCore"
|
#define VER_COMPANYNAME_STR "AzerothCore"
|
||||||
#define VER_LEGALCOPYRIGHT_STR "AzerothCore"
|
#define VER_LEGALCOPYRIGHT_STR "(c)2016-@rev_year@ AzerothCore"
|
||||||
#define VER_FILEVERSION 0,0,0
|
#define VER_FILEVERSION 0,0,0
|
||||||
#define VER_FILEVERSION_STR "@rev_hash@ @rev_date@ (@rev_branch@ branch)"
|
#define VER_FILEVERSION_STR "@rev_hash@ @rev_date@ (@rev_branch@ branch)"
|
||||||
#define VER_PRODUCTVERSION VER_FILEVERSION
|
#define VER_PRODUCTVERSION VER_FILEVERSION
|
||||||
|
|||||||
Reference in New Issue
Block a user