From 6b6a12ab45474929178a3162523bcba21b9fe509 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Thu, 1 Feb 2024 10:45:30 +1000 Subject: [PATCH] chore(radio): Automate copyright year based on build date (#4579) --- CMakeLists.txt | 1 + companion/src/CMakeLists.txt | 2 -- radio/src/gui/128x64/view_about.cpp | 2 +- radio/src/gui/212x64/view_about.cpp | 2 +- radio/src/gui/colorlcd/view_about.cpp | 2 +- radio/src/stamp.h.in | 1 + 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e1e41d44..c51963d08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ set(VERSION_MAJOR "2") set(VERSION_MINOR "10") set(VERSION_REVISION "0") set(CODENAME "dev") +string(TIMESTAMP BUILD_YEAR "%Y") if(MINGW OR WIN32) set(CMAKE_OBJECT_PATH_MAX 200) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index a0e784e57..6d9e04d63 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -92,7 +92,6 @@ include_directories( ) ############# Do macro replacements on input files ############# -string(TIMESTAMP BUILD_YEAR "%Y") configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY) configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY) @@ -420,7 +419,6 @@ elseif(WIN32) endif() endif() - string(TIMESTAMP BUILD_YEAR "%Y") set(LICENSE_FILE "${CMAKE_CURRENT_BINARY_DIR}/license.txt") configure_file("${COMPANION_SRC_DIRECTORY}/../targets/windows/license.txt.in" ${LICENSE_FILE} @ONLY) install(FILES "${LICENSE_FILE}" DESTINATION ${INSTALL_DESTINATION}) diff --git a/radio/src/gui/128x64/view_about.cpp b/radio/src/gui/128x64/view_about.cpp index b34271738..24a9aab81 100644 --- a/radio/src/gui/128x64/view_about.cpp +++ b/radio/src/gui/128x64/view_about.cpp @@ -29,7 +29,7 @@ const char ABOUT_VERSION_1[] = "EdgeTX " "(" VERSION_TAG ")" "\036\"" CODENAME " #else const char ABOUT_VERSION_1[] = "EdgeTX " "(" VERSION "-" VERSION_SUFFIX ")"; #endif -const char ABOUT_VERSION_2[] = "Copyright (C) 2024 EdgeTX"; +const char ABOUT_VERSION_2[] = "Copyright (C) " BUILD_YEAR " EdgeTX"; const char ABOUT_VERSION_3[] = "https://edgetx.org"; void menuAboutView(event_t event) diff --git a/radio/src/gui/212x64/view_about.cpp b/radio/src/gui/212x64/view_about.cpp index 45e99fdf1..505e46d88 100644 --- a/radio/src/gui/212x64/view_about.cpp +++ b/radio/src/gui/212x64/view_about.cpp @@ -29,7 +29,7 @@ const char ABOUT_VERSION_1[] = "EdgeTX " "\"" CODENAME "\"" " (" VERSION_TAG ")" #else const char ABOUT_VERSION_1[] = "EdgeTX " "(" VERSION "-" VERSION_SUFFIX ")"; #endif -const char ABOUT_VERSION_2[] = "Copyright (C) 2024 EdgeTX"; +const char ABOUT_VERSION_2[] = "Copyright (C) " BUILD_YEAR " EdgeTX"; const char ABOUT_VERSION_3[] = "https://edgetx.org"; void menuAboutView(event_t event) diff --git a/radio/src/gui/colorlcd/view_about.cpp b/radio/src/gui/colorlcd/view_about.cpp index 21f9dde55..0f939866f 100644 --- a/radio/src/gui/colorlcd/view_about.cpp +++ b/radio/src/gui/colorlcd/view_about.cpp @@ -29,7 +29,7 @@ const std::string about_str = "EdgeTX" " (" VERSION_TAG ")\n" "\"" CODENAME "\"" #else const std::string about_str = "EdgeTX" " (" VERSION "-" VERSION_SUFFIX ")"; #endif -const std::string copyright_str = "Copyright (C) 2024 EdgeTX"; +const std::string copyright_str = "Copyright (C) " BUILD_YEAR " EdgeTX"; const std::string edgetx_url = "https://edgetx.org"; AboutUs::AboutUs() : diff --git a/radio/src/stamp.h.in b/radio/src/stamp.h.in index 484e592b2..eae73f752 100644 --- a/radio/src/stamp.h.in +++ b/radio/src/stamp.h.in @@ -9,3 +9,4 @@ #define VERSION_MINOR @VERSION_MINOR@ #define VERSION_REVISION @VERSION_REVISION@ #define GIT_STR "@GIT_STR@" +#define BUILD_YEAR "@BUILD_YEAR@"