Build: Set correct year in VER_LEGALCOPYRIGHT_STR

# Conflicts:
#	revision_data.h.in.cmake
This commit is contained in:
Shauren authored and Ovahlord committed 2021-05-17 15:06:00 +02:00
1 parent 95651d9f88
commit 37d67ac8d2
2 files changed
+13 -1

No files matched your search

+12
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)
# 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_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})
# Extract information required to build a proper versionstring
string(REGEX REPLACE init-|[0-9]+-g "" rev_hash ${rev_info})
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}" MATCHES "${rev_hash}" OR NOT "${rev_branch_cached}" MATCHES "${rev_branch}" OR NOT EXISTS "${BUILDDIR}/revision_data.h")
configure_file(