conf.py.in 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
  28. cmake_manual_description = re.compile('^\.\. cmake-manual-description:(.*)$')
  29. man_pages = []
  30. for fpath in cmake_manuals:
  31. try:
  32. name, sec, rst = os.path.basename(fpath).split('.')
  33. desc = None
  34. f = open(fpath, 'r')
  35. for l in f:
  36. m = cmake_manual_description.match(l)
  37. if m:
  38. desc = m.group(1).strip()
  39. break
  40. f.close()
  41. if desc:
  42. man_pages.append(('manual/%s.%s' % (name, sec),
  43. name, desc, [], int(sec)))
  44. else:
  45. sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
  46. except Exception, e:
  47. sys.stderr.write("ERROR: %s\n" % str(e))
  48. man_show_urls = False
  49. html_show_sourcelink = True
  50. html_static_path = ['@conf_path@/static']
  51. html_style = 'cmake.css'
  52. html_theme = 'default'
  53. html_title = 'CMake %s Documentation' % release
  54. html_short_title = '%s Documentation' % release
  55. html_favicon = 'cmake-favicon.ico'