Build: Set correct year in VER_LEGALCOPYRIGHT_STR

(cherry picked from commit 68a490923d)
This commit is contained in:
Shauren
2021-05-16 22:32:42 +02:00
parent db3eb418b8
commit 15ff8fff36
2 changed files with 13 additions and 1 deletions

View File

@@ -20,6 +20,8 @@ if(WITHOUT_GIT)
set(rev_date "1970-01-01 00:00:00 +0000")
set(rev_hash "unknown")
set(rev_branch "Archived")
# No valid git commit date, use today
string(TIMESTAMP rev_date_fallback "%Y-%m-%d %H:%M:%S" UTC)
else()
if(GIT_EXECUTABLE)
# Retrieve repository dirty status
@@ -102,10 +104,20 @@ else()
set(rev_date "1970-01-01 00:00:00 +0000")
set(rev_hash "unknown")
set(rev_branch "Archived")
# No valid git commit date, use today
string(TIMESTAMP rev_date_fallback "%Y-%m-%d %H:%M:%S" UTC)
else()
# We have valid date from git commit, use that
set(rev_date_fallback ${rev_date})
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_data.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_data.h")
configure_file(

View File

@@ -12,7 +12,7 @@
#define _FULL_DATABASE "TDB_full_world_920.22031_2022_03_06.sql"
#define _HOTFIXES_DATABASE "TDB_full_hotfixes_920.22031_2022_03_06.sql"
#define VER_COMPANYNAME_STR "TrinityCore Developers"
#define VER_LEGALCOPYRIGHT_STR "(c)2008-2022 TrinityCore"
#define VER_LEGALCOPYRIGHT_STR "(c)2008-@rev_year@ TrinityCore"
#define VER_FILEVERSION 0,0,0
#define VER_FILEVERSION_STR "@rev_hash@ @rev_date@ (@rev_branch@ branch)"
#define VER_PRODUCTVERSION VER_FILEVERSION