From c2c84d27f67c9dba96da65c924f135b07e2bc657 Mon Sep 17 00:00:00 2001 From: Martin Marmsoler Date: Mon, 23 Jan 2023 09:50:50 +0100 Subject: [PATCH] update copyright and license year automatically --- CMakeLists.txt | 5 +++++ LICENSE.md => LICENSE.md.in | 2 +- pack/CMakeLists.txt | 2 +- src/dialogs/AboutDialog.cpp | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) rename LICENSE.md => LICENSE.md.in (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f58abfa..d2a0b851 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,11 @@ set(GITTYUP_VERSION "${GITTYUP_VERSION_MAJOR}.${GITTYUP_VERSION_MINOR}.${GITTYUP_VERSION_PATCH}" ) +string(TIMESTAMP CURR_YEAR "%Y") +add_compile_definitions(CURR_YEAR=${CURR_YEAR}) +configure_file(${CMAKE_SOURCE_DIR}/LICENSE.md.in ${CMAKE_BINARY_DIR}/LICENSE.md + @ONLY) + # Write version to file so it can be used also from external, for example in the # github manifest file(WRITE "${CMAKE_BINARY_DIR}/Version.txt" ${GITTYUP_VERSION}) diff --git a/LICENSE.md b/LICENSE.md.in similarity index 95% rename from LICENSE.md rename to LICENSE.md.in index 06c55155..cd7de576 100644 --- a/LICENSE.md +++ b/LICENSE.md.in @@ -1,7 +1,7 @@ MIT License Copyright (c) 2018 Scientific Toolworks, Inc. -Copyright (c) 2021-2022 Gittyup contributors +Copyright (c) 2021-@CURR_YEAR@ Gittyup contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/pack/CMakeLists.txt b/pack/CMakeLists.txt index eea79fe5..3cb12490 100644 --- a/pack/CMakeLists.txt +++ b/pack/CMakeLists.txt @@ -283,7 +283,7 @@ set(CPACK_PACKAGE_VERSION_MINOR ${GITTYUP_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${GITTYUP_VERSION_PATCH}) if(WIN32) - set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.md) + set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_BINARY_DIR}/LICENSE.md) endif() set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/dialogs/AboutDialog.cpp b/src/dialogs/AboutDialog.cpp index af3868b3..ac202c7e 100644 --- a/src/dialogs/AboutDialog.cpp +++ b/src/dialogs/AboutDialog.cpp @@ -42,7 +42,9 @@ const QString kSubtitleFmt = "

%2

"; const QString kTextFmt = "

%1 v%2 " - "- %3 - %4
Copyright © 2021-2022 Gittyup contributors" + "- %3 - %4
Copyright © 2021-" + + QString::number(CURR_YEAR) + + " Gittyup contributors" "
Copyright © 2016-2020 Scientific Toolworks, Inc. and " "contributors

If you have a question that might benefit the " "community, consider asking it on Stack Overflow by "