conf.py.in 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #=============================================================================
  2. # CMake - Cross Platform Makefile Generator
  3. # Copyright 2000-2013 Kitware, Inc., Insight Software Consortium
  4. #
  5. # Distributed under the OSI-approved BSD License (the "License");
  6. # see accompanying file Copyright.txt for details.
  7. #
  8. # This software is distributed WITHOUT ANY WARRANTY; without even the
  9. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. # See the License for more information.
  11. #=============================================================================
  12. import sys
  13. import os
  14. import re
  15. import glob
  16. sys.path.insert(0, r'@conf_path@')
  17. source_suffix = '.rst'
  18. master_doc = 'index'
  19. project = 'CMake'
  20. copyright = '@conf_copyright@'
  21. version = '@conf_version@' # feature version
  22. release = '@conf_release@' # full version string
  23. primary_domain = 'cmake'
  24. exclude_patterns = []
  25. extensions = ['cmake']
  26. templates_path = ['@conf_path@/templates']
  27. nitpicky = True
  28. cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
  29. cmake_manual_description = re.compile('^\.\. cmake-manual-description:(.*)$')
  30. man_pages = []
  31. for fpath in cmake_manuals:
  32. try:
  33. name, sec, rst = os.path.basename(fpath).split('.')
  34. desc = None
  35. f = open(fpath, 'r')
  36. for l in f:
  37. m = cmake_manual_description.match(l)
  38. if m:
  39. desc = m.group(1).strip()
  40. break
  41. f.close()
  42. if desc:
  43. man_pages.append(('manual/%s.%s' % (name, sec),
  44. name, desc, [], int(sec)))
  45. else:
  46. sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
  47. except Exception as e:
  48. sys.stderr.write("ERROR: %s\n" % str(e))
  49. man_show_urls = False
  50. html_show_sourcelink = True
  51. html_static_path = ['@conf_path@/static']
  52. html_style = 'cmake.css'
  53. html_theme = 'default'
  54. html_title = 'CMake %s Documentation' % release
  55. html_short_title = '%s Documentation' % release
  56. html_favicon = '@conf_path@/static/cmake-favicon.ico'
  57. # Not supported yet by sphinx:
  58. # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable
  59. # qthelp_namespace = "org.cmake"
  60. # qthelp_qch_name = "CMake-300.qch"