浏览代码

Help: Configure copyright year automatically

Teach our Sphinx conf.py to compute the copyright end year
automatically.  Drop our hard-coded configuration for it.
Brad King 12 年之前
父节点
当前提交
edc7cc967d
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 0 1
      Utilities/Sphinx/CMakeLists.txt
  2. 3 2
      Utilities/Sphinx/conf.py.in

+ 0 - 1
Utilities/Sphinx/CMakeLists.txt

@@ -38,7 +38,6 @@ endif()
 
 
 set(conf_docs "${CMake_SOURCE_DIR}/Help")
 set(conf_docs "${CMake_SOURCE_DIR}/Help")
 set(conf_path "${CMAKE_CURRENT_SOURCE_DIR}")
 set(conf_path "${CMAKE_CURRENT_SOURCE_DIR}")
-set(conf_copyright "2000-2013 Kitware, Inc.")
 set(conf_version "${CMake_MAJOR_VERSION}.${CMake_MINOR_VERSION}.${CMake_PATCH_VERSION}")
 set(conf_version "${CMake_MAJOR_VERSION}.${CMake_MINOR_VERSION}.${CMake_PATCH_VERSION}")
 set(conf_release "${CMake_VERSION}")
 set(conf_release "${CMake_VERSION}")
 configure_file(conf.py.in conf.py @ONLY)
 configure_file(conf.py.in conf.py @ONLY)

+ 3 - 2
Utilities/Sphinx/conf.py.in

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