conf.py.in 1.8 KB

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