summaryrefslogtreecommitdiffstats
path: root/Utilities/Sphinx/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-13 14:18:57 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-13 14:18:57 (GMT)
commit3bade75b02cd4989d0be5efc6547439eade22be9 (patch)
treebd90dc380bb1615c9720197143d7ddb5a954c450 /Utilities/Sphinx/CMakeLists.txt
parent2bbf6bd7f880ee618dd1260d784ba88b042dbf89 (diff)
downloadCMake-3bade75b02cd4989d0be5efc6547439eade22be9.zip
CMake-3bade75b02cd4989d0be5efc6547439eade22be9.tar.gz
CMake-3bade75b02cd4989d0be5efc6547439eade22be9.tar.bz2
Help: Parse Copyright.txt instead of using current year
Configure our Sphinx conf.py with a copyright line extracted from Copyright.txt instead of using the year in which the documentation is built. This will future-proof the reported copyright year range when building documentation for old versions.
Diffstat (limited to 'Utilities/Sphinx/CMakeLists.txt')
-rw-r--r--Utilities/Sphinx/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 3b0b335..5e0ef87 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -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}")