summaryrefslogtreecommitdiffstats
path: root/Utilities/Sphinx/cmake.py
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2017-02-09 17:48:31 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-10 15:24:25 (GMT)
commit971384c28759ad042624bda3893be6fdb1795591 (patch)
treeb544f05e5a2544f0766ef9a1296a721fb5d369e1 /Utilities/Sphinx/cmake.py
parent92be2fb392d694dffc80e635f4ac10212cfd7ef9 (diff)
downloadCMake-971384c28759ad042624bda3893be6fdb1795591.zip
CMake-971384c28759ad042624bda3893be6fdb1795591.tar.gz
CMake-971384c28759ad042624bda3893be6fdb1795591.tar.bz2
Utilities/Sphinx: Port cmake extension to Sphinx 1.4
Sphinx 1.4 introduced a breaking change to `indexnode` by changing the length of a tuple. Teach our extension to produce a tuple of the proper length for the version of Sphinx in use. This gets rid of the "4 column based index found" warning.
Diffstat (limited to 'Utilities/Sphinx/cmake.py')
-rw-r--r--Utilities/Sphinx/cmake.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index edc7667..6f273f9 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -46,7 +46,7 @@ from sphinx.directives import ObjectDescription
from sphinx.domains import Domain, ObjType
from sphinx.roles import XRefRole
from sphinx.util.nodes import make_refnode
-from sphinx import addnodes
+from sphinx import addnodes, version_info
class CMakeModule(Directive):
required_arguments = 1
@@ -123,7 +123,11 @@ class _cmake_index_entry:
self.desc = desc
def __call__(self, title, targetid, main = 'main'):
- return ('pair', u'%s ; %s' % (self.desc, title), targetid, main)
+ # See https://github.com/sphinx-doc/sphinx/issues/2673
+ if version_info < (1, 4):
+ return ('pair', u'%s ; %s' % (self.desc, title), targetid, main)
+ else:
+ return ('pair', u'%s ; %s' % (self.desc, title), targetid, main, None)
_cmake_index_objs = {
'command': _cmake_index_entry('command'),