diff --git a/CMakeLists.txt b/CMakeLists.txt index a9e68dc1aa..50b9ace038 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,7 @@ set(PACKAGE_VERSION_MINOR "2") set(PACKAGE_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release) set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string) set(PACKAGE_BUILD_VERSION "0") # used when the same FreeCAD version will be re-released (for example using an updated LibPack) +string(TIMESTAMP PACKAGE_COPYRIGHT_YEAR "%Y") set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}") set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}") diff --git a/src/Build/Version.h.cmake b/src/Build/Version.h.cmake index eda5cec5ef..00b8a36455 100644 --- a/src/Build/Version.h.cmake +++ b/src/Build/Version.h.cmake @@ -5,6 +5,8 @@ #define FCVersionName "${PACKAGE_VERSION_NAME}" #define FCVersionPoint "${PACKAGE_VERSION_PATCH}" #define FCVersionSuffix "${PACKAGE_VERSION_SUFFIX}" +// Displayed Copyright Year (i.e. build year) +#define FCCopyrightYear ${PACKAGE_COPYRIGHT_YEAR} // test: $Format:Hash (%H), Date: %ci$ #define FCRevision "${PACKAGE_WCREF}" //Highest committed revision number #define FCRevisionDate "${PACKAGE_WCDATE}" //Date of highest committed revision diff --git a/src/Main/FreeCADGuiPy.cpp b/src/Main/FreeCADGuiPy.cpp index 257a84356e..583ac6722b 100644 --- a/src/Main/FreeCADGuiPy.cpp +++ b/src/Main/FreeCADGuiPy.cpp @@ -27,6 +27,8 @@ # include #endif // HAVE_CONFIG_H +#include // For FCCopyrightYear + #ifdef _MSC_VER # pragma warning(disable : 4005) #endif @@ -338,7 +340,7 @@ PyMOD_INIT_FUNC(FreeCADGui) Base::Interpreter().loadModule("FreeCAD"); App::Application::Config()["AppIcon"] = "freecad"; App::Application::Config()["SplashScreen"] = "freecadsplash"; - App::Application::Config()["CopyrightInfo"] = "\xc2\xa9 Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2026\n"; + App::Application::Config()["CopyrightInfo"] = fmt::format("\xc2\xa9 Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-{}\n", FCCopyrightYear); App::Application::Config()["LicenseInfo"] = "FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.\n"; App::Application::Config()["CreditsInfo"] = "FreeCAD would not be possible without the FreeCAD community.\n"; // clang-format on diff --git a/src/Main/MainCmd.cpp b/src/Main/MainCmd.cpp index 88ff837561..faab6db67a 100644 --- a/src/Main/MainCmd.cpp +++ b/src/Main/MainCmd.cpp @@ -28,6 +28,8 @@ # include #endif // HAVE_CONFIG_H +#include // For FCCopyrightYear + #include #include #include @@ -44,9 +46,11 @@ using App::Application; using Base::Console; -const char sBanner[] - = "(C) 2001-2026 FreeCAD contributors\n" - "FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.\n\n"; +const auto sBanner = fmt::format( + "(C) 2001-{} FreeCAD contributors\n" + "FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.\n\n", + FCCopyrightYear +); int main(int argc, char** argv) { diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index cec9ed4569..16a2617273 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -33,6 +33,8 @@ # include #endif // HAVE_CONFIG_H +#include // For FCCopyrightYear + #include #include #include @@ -52,9 +54,11 @@ void PrintInitHelp(); -const char sBanner[] - = "(C) 2001-2026 FreeCAD contributors\n" - "FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.\n\n"; +const auto sBanner = fmt::format( + "(C) 2001-{} FreeCAD contributors\n" + "FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.\n\n", + FCCopyrightYear +); #if defined(_MSC_VER) void InitMiniDumpWriter(const std::string&);