From 068ea4bfc1fcf5b90395660749a5de4e3b5333bd Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 17:35:34 -0500 Subject: [PATCH 1/9] cmake-gui: Update credits in About dialog to reflect status quo --- Source/QtDialog/CMakeSetupDialog.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index a7ae2915c5..64ae722c74 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -1024,8 +1024,7 @@ void CMakeSetupDialog::doAbout() "CMake suite maintained and supported by Kitware (kitware.com/cmake).\n" "Distributed under terms of the BSD 3-Clause License.\n" "\n" - "CMake GUI maintained by csimsoft,\n" - "built using Qt %2 (qt-project.org).\n" + "CMake GUI built using Qt %2 (qt-project.org).\n" #ifdef USE_LGPL "\n" "The Qt Toolkit is Copyright (C) The Qt Company Ltd.\n" From 3035ee4ff37c82202fce44913ccf273b0d636490 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 19:32:57 -0500 Subject: [PATCH 2/9] CMake: De-duplicate extraction of copyright line from license file --- CMakeLists.txt | 1 + Source/CMakeCopyright.cmake | 10 ++++++++++ Source/QtDialog/CMakeLists.txt | 5 +---- Utilities/Sphinx/CMakeLists.txt | 6 ++---- 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 Source/CMakeCopyright.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 749404d0a4..2887d3e03e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -386,6 +386,7 @@ endif() # The main section of the CMakeLists file # #----------------------------------------------------------------------- +include(Source/CMakeCopyright.cmake) include(Source/CMakeVersion.cmake) include(CTest) diff --git a/Source/CMakeCopyright.cmake b/Source/CMakeCopyright.cmake new file mode 100644 index 0000000000..8965cf69e0 --- /dev/null +++ b/Source/CMakeCopyright.cmake @@ -0,0 +1,10 @@ +# CMake license file and copyright line. +set(CMake_LICENSE_FILE "${CMake_SOURCE_DIR}/Copyright.txt") +file(STRINGS "${CMake_LICENSE_FILE}" CMake_COPYRIGHT_LINE LIMIT_COUNT 1 REGEX "^Copyright ") +if(NOT CMake_COPYRIGHT_LINE MATCHES [[^Copyright 2000-2[0-9][0-9][0-9] Kitware, Inc\. and Contributors$]]) + message(FATAL_ERROR + "The CMake license file:\n" + " ${CMake_LICENSE_FILE}\n" + "does not contain a copyright line matching the expected pattern." + ) +endif() diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 55f40bf476..187fedc9b8 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -306,15 +306,12 @@ Checks: '-*,llvm-twine-local' ") if(APPLE) - file(STRINGS "${CMake_SOURCE_DIR}/Copyright.txt" copyright_line - LIMIT_COUNT 1 REGEX "^Copyright 2000-20[0-9][0-9] Kitware") - set_target_properties(cmake-gui PROPERTIES OUTPUT_NAME CMake MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in" MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}" # TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}" - MACOSX_BUNDLE_COPYRIGHT "${copyright_line}" + MACOSX_BUNDLE_COPYRIGHT "${CMake_COPYRIGHT_LINE}" MACOSX_BUNDLE_GUI_IDENTIFIER "org.cmake.cmake" ) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index a919b9147a..e7a53ab872 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -7,6 +7,7 @@ if(NOT CMake_SOURCE_DIR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) + include(${CMake_SOURCE_DIR}/Source/CMakeCopyright.cmake) include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake) include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake @ONLY) @@ -50,10 +51,7 @@ elseif(NOT SPHINX_EXECUTABLE) message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") endif() -set(copyright_line_regex "^Copyright (2000-20[0-9][0-9] Kitware.*)") -file(STRINGS "${CMake_SOURCE_DIR}/Copyright.txt" copyright_line - LIMIT_COUNT 1 REGEX "${copyright_line_regex}") -if(copyright_line MATCHES "${copyright_line_regex}") +if(CMake_COPYRIGHT_LINE MATCHES "^Copyright (.*)$") set(conf_copyright "${CMAKE_MATCH_1}") else() set(conf_copyright "Kitware, Inc.") From 759cd843dba287625e6768ced97ebb87c10e2da5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 19:39:50 -0500 Subject: [PATCH 3/9] CMake: De-duplicate references to license file --- CMakeCPack.cmake | 4 ++-- CMakeLists.txt | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index a0c0e54ffa..e6bd57a064 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -14,10 +14,10 @@ if(CMake_INSTALL_DEPENDENCIES) include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) endif() +set(CPACK_RESOURCE_FILE_LICENSE "${CMake_LICENSE_FILE}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") set(CPACK_PACKAGE_VENDOR "Kitware") -set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_LICENSE}") set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_PACKAGE_VERSION "${CMake_VERSION}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") diff --git a/CMakeLists.txt b/CMakeLists.txt index 2887d3e03e..d7fd071f6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -534,7 +534,9 @@ endif() if(NOT CMake_TEST_EXTERNAL_CMAKE) # Install license file as it requires. - install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}) + install(FILES + "${CMake_LICENSE_FILE}" + DESTINATION ${CMAKE_DOC_DIR}) # Install script directories. install( From a9190bd38d96b7409be9ec1f3f56d2c6b3d58c85 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 21:06:47 -0500 Subject: [PATCH 4/9] CMake: Prepare dedicated license file for our own CPack configuration The CPack WIX Generator requires a `.txt` file extension. Provide that regardless of the actual license file extension. --- CMakeCPack.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index e6bd57a064..b88da62f1a 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -14,7 +14,9 @@ if(CMake_INSTALL_DEPENDENCIES) include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) endif() -set(CPACK_RESOURCE_FILE_LICENSE "${CMake_LICENSE_FILE}") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LICENSE.txt") +configure_file("${CMake_LICENSE_FILE}" "${CPACK_RESOURCE_FILE_LICENSE}" COPYONLY) + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") set(CPACK_PACKAGE_VENDOR "Kitware") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_LICENSE}") From 97eb4ee9667da8cda42c685efb0dfff4b9b95187 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Tue, 25 Feb 2025 20:25:24 +0300 Subject: [PATCH 5/9] Copyright.txt: Update email Backport commit 953daaac85 (Copyright.txt: Update email, 2025-02-25). --- Copyright.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Copyright.txt b/Copyright.txt index f32a818aad..fe51320a84 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -68,7 +68,7 @@ The following individuals and institutions are among the Contributors: * Jordan Williams * Julien Schueller * Kelly Thompson -* Konstantin Podsvirov +* Konstantin Podsvirov * Laurent Montel * Mario Bensi * Martin Gräßlin From afeca383d6598da3fd01d3a48ec2e8ee6c4b240d Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 20:43:00 -0500 Subject: [PATCH 6/9] Copyright.txt: Drop outdated content around copyright notice line The modern convention for BSD 3-Clause license notices does not include the name of the project or "All rights reserved". --- Copyright.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Copyright.txt b/Copyright.txt index fe51320a84..7c98c813b9 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -1,6 +1,4 @@ -CMake - Cross Platform Makefile Generator Copyright 2000-2025 Kitware, Inc. and Contributors -All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions From 834c9236e4dc1be7d1562f7458200f02a0b62763 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 20:24:39 -0500 Subject: [PATCH 7/9] Copyright.txt: Remove excess indentation --- Copyright.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Copyright.txt b/Copyright.txt index 7c98c813b9..c8dc7077a7 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -121,14 +121,14 @@ documented in corresponding subdirectories or source files. CMake was initially developed by Kitware with the following sponsorship: - * National Library of Medicine at the National Institutes of Health - as part of the Insight Segmentation and Registration Toolkit (ITK). +* National Library of Medicine at the National Institutes of Health + as part of the Insight Segmentation and Registration Toolkit (ITK). - * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel - Visualization Initiative. +* US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel + Visualization Initiative. - * National Alliance for Medical Image Computing (NAMIC) is funded by the - National Institutes of Health through the NIH Roadmap for Medical Research, - Grant U54 EB005149. +* National Alliance for Medical Image Computing (NAMIC) is funded by the + National Institutes of Health through the NIH Roadmap for Medical Research, + Grant U54 EB005149. - * Kitware, Inc. +* Kitware, Inc. From 53175648947e906c3a6d9ca48039bd6fa16cc96c Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 20:25:01 -0500 Subject: [PATCH 8/9] Copyright.txt: Add contributor section headers --- Copyright.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Copyright.txt b/Copyright.txt index c8dc7077a7..b7271ba5ba 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -27,9 +27,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- +Contributors +************ -The following individuals and institutions are among the Contributors: +The following individuals and institutions are among the contributors: * Aaron C. Meadows * Adriaan de Groot @@ -112,12 +113,16 @@ The following individuals and institutions are among the Contributors: See version control history for details of individual contributions. +Copyright +========= + The above copyright and license notice applies to distributions of CMake in source and binary form. Third-party software packages supplied with CMake under compatible licenses provide their own copyright notices documented in corresponding subdirectories or source files. ------------------------------------------------------------------------------- +Sponsorship +=========== CMake was initially developed by Kitware with the following sponsorship: From 2d42a5444f859891b6598c76ea5d51510013565e Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 2 Mar 2025 20:58:26 -0500 Subject: [PATCH 9/9] LICENSE: Rename Copyright.txt to LICENSE.rst The name `LICENSE` is now more conventional. Format as reStructuredText to improve rendering. --- .codespellrc | 2 +- .gitlab/ci/cmake_version_update.sh | 2 +- .typos.toml | 2 +- CONTRIBUTING.rst | 4 ++-- Copyright.txt => LICENSE.rst | 0 README.rst | 4 ++-- Source/CMakeCopyright.cmake | 2 +- Source/CMakeVersion.bash | 2 +- Tests/CMakeCopyright.cmake | 8 ++++---- Tests/CMakeTests/ModuleNoticesTest.cmake.in | 2 +- bootstrap | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) rename Copyright.txt => LICENSE.rst (100%) diff --git a/.codespellrc b/.codespellrc index 2551ccab30..6b1398b25a 100644 --- a/.codespellrc +++ b/.codespellrc @@ -10,8 +10,8 @@ skip = .git, .typos.toml, build, - Copyright.txt, CTestCustom.cmake.in, + LICENSE.rst, Modules/Internal/CPack/NSIS.template.in, Source/CursesDialog/form/*, Source/kwsys/*, diff --git a/.gitlab/ci/cmake_version_update.sh b/.gitlab/ci/cmake_version_update.sh index 3c05dfeb23..e73419d78a 100755 --- a/.gitlab/ci/cmake_version_update.sh +++ b/.gitlab/ci/cmake_version_update.sh @@ -25,7 +25,7 @@ for try in $(seq $n); do git reset -q --hard FETCH_HEAD Source/CMakeVersion.bash git update-index -q --ignore-missing --refresh - modified=$(git diff-index --name-only HEAD -- "Source/CMakeVersion.cmake" "Copyright.txt") + modified=$(git diff-index --name-only HEAD -- "Source/CMakeVersion.cmake" "LICENSE.rst") if test -n "$modified"; then echo "version changed" git add -u diff --git a/.typos.toml b/.typos.toml index c06745a69c..d1ccb1224b 100644 --- a/.typos.toml +++ b/.typos.toml @@ -57,7 +57,7 @@ SEH = "SEH" ignore-hidden = false ignore-dot = false extend-exclude = [ - "Copyright.txt" + "LICENSE.rst" # Exclude third-party sources. , "Source/CursesDialog/form/" , "Source/kwsys/" diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 88f39f18ea..7247467b43 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -74,6 +74,6 @@ License We do not require any formal copyright assignment or contributor license agreement. Any contributions intentionally sent upstream are presumed to be offered under terms of the OSI-approved BSD 3-clause License. -See `Copyright.txt`_ for details. +See `LICENSE.rst`_ for details. -.. _`Copyright.txt`: Copyright.txt +.. _`LICENSE.rst`: LICENSE.rst diff --git a/Copyright.txt b/LICENSE.rst similarity index 100% rename from Copyright.txt rename to LICENSE.rst diff --git a/README.rst b/README.rst index 8a471db0e9..3eefaf9b5d 100644 --- a/README.rst +++ b/README.rst @@ -22,9 +22,9 @@ License ======= CMake is distributed under the OSI-approved BSD 3-clause License. -See `Copyright.txt`_ for details. +See `LICENSE.rst`_ for details. -.. _`Copyright.txt`: Copyright.txt +.. _`LICENSE.rst`: LICENSE.rst Building CMake ============== diff --git a/Source/CMakeCopyright.cmake b/Source/CMakeCopyright.cmake index 8965cf69e0..ce0d2ed363 100644 --- a/Source/CMakeCopyright.cmake +++ b/Source/CMakeCopyright.cmake @@ -1,5 +1,5 @@ # CMake license file and copyright line. -set(CMake_LICENSE_FILE "${CMake_SOURCE_DIR}/Copyright.txt") +set(CMake_LICENSE_FILE "${CMake_SOURCE_DIR}/LICENSE.rst") file(STRINGS "${CMake_LICENSE_FILE}" CMake_COPYRIGHT_LINE LIMIT_COUNT 1 REGEX "^Copyright ") if(NOT CMake_COPYRIGHT_LINE MATCHES [[^Copyright 2000-2[0-9][0-9][0-9] Kitware, Inc\. and Contributors$]]) message(FATAL_ERROR diff --git a/Source/CMakeVersion.bash b/Source/CMakeVersion.bash index 59f8ec284a..f0e4996d82 100755 --- a/Source/CMakeVersion.bash +++ b/Source/CMakeVersion.bash @@ -12,6 +12,6 @@ if version_patch_line=$(grep -E '^set\(CMake_VERSION_PATCH [0-9]{8}\)' "$version if [[ "$version_patch_year" =~ ^[0-9][0-9][0-9][0-9]$ ]] ; then sed -i -e ' s/\(^Copyright 2000-\)[0-9][0-9][0-9][0-9]\( .*\)/\1'"$version_patch_year"'\2/ - ' "${BASH_SOURCE%/*}/../Copyright.txt" + ' "${BASH_SOURCE%/*}/../LICENSE.rst" fi fi diff --git a/Tests/CMakeCopyright.cmake b/Tests/CMakeCopyright.cmake index a7201e97d1..2c3c95d098 100644 --- a/Tests/CMakeCopyright.cmake +++ b/Tests/CMakeCopyright.cmake @@ -1,21 +1,21 @@ if(CMAKE_VERSION MATCHES "\\.(20[0-9][0-9])[0-9][0-9][0-9][0-9](-|$)") set(version_year "${CMAKE_MATCH_1}") set(copyright_line_regex "^Copyright 2000-(20[0-9][0-9]) Kitware") - file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../Copyright.txt" copyright_line + file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../LICENSE.rst" copyright_line LIMIT_COUNT 1 REGEX "${copyright_line_regex}") if(copyright_line MATCHES "${copyright_line_regex}") set(copyright_year "${CMAKE_MATCH_1}") if(copyright_year LESS version_year) - message(FATAL_ERROR "Copyright.txt contains\n" + message(FATAL_ERROR "LICENSE.rst contains\n" " ${copyright_line}\n" "but the current version year is ${version_year}.") else() - message(STATUS "PASSED: Copyright.txt contains\n" + message(STATUS "PASSED: LICENSE.rst contains\n" " ${copyright_line}\n" "and the current version year is ${version_year}.") endif() else() - message(FATAL_ERROR "Copyright.txt has no Copyright line of expected format!") + message(FATAL_ERROR "LICENSE.rst has no Copyright line of expected format!") endif() else() message(STATUS "SKIPPED: CMAKE_VERSION does not know the year: ${CMAKE_VERSION}") diff --git a/Tests/CMakeTests/ModuleNoticesTest.cmake.in b/Tests/CMakeTests/ModuleNoticesTest.cmake.in index 7ae6607fa9..a9efd50de3 100644 --- a/Tests/CMakeTests/ModuleNoticesTest.cmake.in +++ b/Tests/CMakeTests/ModuleNoticesTest.cmake.in @@ -1,6 +1,6 @@ # Regex to match license notices at the top of module files. set(notice_regex [[^# Distributed under the OSI-approved BSD 3-Clause License\. See accompanying -# file Copyright\.txt or https://cmake\.org/licensing for details\. +# file LICENSE\.rst or https://cmake\.org/licensing for details\. ]]) string(REPLACE "\n" "\r?\n" notice_regex "${notice_regex}") diff --git a/bootstrap b/bootstrap index 644260b556..e69f1ebcc3 100755 --- a/bootstrap +++ b/bootstrap @@ -64,7 +64,7 @@ if test "$cmake_version_rc" != ""; then cmake_version="${cmake_version}-rc${cmake_version_rc}" fi -cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.txt"`" +cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/LICENSE.rst"`" cmake_bin_dir_keyword="OTHER" cmake_data_dir_keyword="OTHER"