Build: Set correct year in VER_LEGALCOPYRIGHT_STR
# Conflicts: # revision_data.h.in.cmake
This commit is contained in:
1 parent
95651d9f88
commit
37d67ac8d2
2 files changed
+13
-1
No files matched your search
@@ -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()
|
||||||
if(GIT_EXECUTABLE)
|
if(GIT_EXECUTABLE)
|
||||||
# Create a revision-string that we can use
|
# Create a revision-string that we can use
|
||||||
@@ -60,12 +62,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 init-|[0-9]+-g "" rev_hash ${rev_info})
|
string(REGEX REPLACE init-|[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_data.h file from the above params
|
# Create the actual revision_data.h file from the above params
|
||||||
if(NOT "${rev_hash_cached}" MATCHES "${rev_hash}" OR NOT "${rev_branch_cached}" MATCHES "${rev_branch}" OR NOT EXISTS "${BUILDDIR}/revision_data.h")
|
if(NOT "${rev_hash_cached}" MATCHES "${rev_hash}" OR NOT "${rev_branch_cached}" MATCHES "${rev_branch}" OR NOT EXISTS "${BUILDDIR}/revision_data.h")
|
||||||
configure_file(
|
configure_file(
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#define _FULL_DATABASE "TDB_full_world_434.20091_2020_09_22.sql"
|
#define _FULL_DATABASE "TDB_full_world_434.20091_2020_09_22.sql"
|
||||||
#define _HOTFIXES_DATABASE "TDB_full_hotfixes_434.20091_2020_09_22.sql"
|
#define _HOTFIXES_DATABASE "TDB_full_hotfixes_434.20091_2020_09_22.sql"
|
||||||
#define VER_COMPANYNAME_STR "TrinityCore Developers"
|
#define VER_COMPANYNAME_STR "TrinityCore Developers"
|
||||||
#define VER_LEGALCOPYRIGHT_STR "(c)2008-2020 TrinityCore"
|
#define VER_LEGALCOPYRIGHT_STR "(c)2008-@rev_year@ TrinityCore"
|
||||||
#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