Merge topic 'cmake-copyright-year'

3bade75 Help: Parse Copyright.txt instead of using current year
2bbf6bd Copyright.txt: Add test to check year range
3ee67d0 Copyright.txt: Update year range to end in 2013
621ba1f cmake-gui: Parse Copyright.txt instead of duplicating notice
993b685 bootstrap: Parse Copyright.txt instead of duplicating notice
This commit is contained in:
Brad King 2013-11-13 09:59:12 -05:00 committed by CMake Topic Stage
commit 558a6f1f92
7 changed files with 44 additions and 5 deletions

View File

@ -1,5 +1,6 @@
CMake - Cross Platform Makefile Generator
Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
Copyright 2000-2013 Kitware, Inc.
Copyright 2000-2011 Insight Software Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -111,12 +111,15 @@ if(Qt_BIN_DIR)
endif()
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_BUNDLE_NAME}
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 2000-2013 Kitware, Inc."
MACOSX_BUNDLE_COPYRIGHT "${copyright_line}"
)
# Create a symlink in the build tree to provide a "cmake-gui" next

View File

@ -0,0 +1,22 @@
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
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"
" ${copyright_line}\n"
"but the current version year is ${version_year}.")
else()
message(STATUS "PASSED: Copyright.txt 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!")
endif()
else()
message(STATUS "SKIPPED: CMAKE_VERSION does not know the year: ${CMAKE_VERSION}")
endif()

View File

@ -161,6 +161,9 @@ if(BUILD_TESTING)
set(CMAKE_LONG_TEST_TIMEOUT 1500)
endif()
add_test(NAME CMake.Copyright
COMMAND cmake -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeCopyright.cmake)
# add a bunch of standard build-and-test style tests
ADD_TEST_MACRO(CommandLineTest CommandLineTest)
ADD_TEST_MACRO(FindPackageTest FindPackageTest)

View File

@ -36,6 +36,15 @@ 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}")
set(conf_copyright "${CMAKE_MATCH_1}")
else()
set(conf_copyright "Kitware, Inc.")
endif()
set(conf_docs "${CMake_SOURCE_DIR}/Help")
set(conf_path "${CMAKE_CURRENT_SOURCE_DIR}")
set(conf_version "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")

View File

@ -13,7 +13,6 @@ import sys
import os
import re
import glob
import time
sys.path.insert(0, r'@conf_path@')
@ -21,7 +20,7 @@ source_suffix = '.rst'
master_doc = 'index'
project = 'CMake'
copyright = '2000-%s Kitware, Inc.' % time.strftime('%Y')
copyright = '@conf_copyright@'
version = '@conf_version@' # feature version
release = '@conf_release@' # full version string

View File

@ -62,6 +62,8 @@ if [ "$cmake_version_rc" != "" ]; then
cmake_version="${cmake_version}-rc${cmake_version_rc}"
fi
cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.txt"`"
cmake_data_dir_keyword="OTHER"
cmake_doc_dir_keyword="OTHER"
cmake_man_dir_keyword="OTHER"
@ -402,7 +404,7 @@ Directory and file names:
# Display CMake bootstrap usage
cmake_version_display()
{
echo "CMake ${cmake_version}, Copyright 2000-2012 Kitware, Inc."
echo "CMake ${cmake_version}, ${cmake_copyright}"
}
# Display CMake bootstrap error, display the log file and exit