conf.py.in 1.8 KB

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