diff options
author | Brad King <brad.king@kitware.com> | 2017-02-10 16:32:21 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-02-10 16:32:21 (GMT) |
commit | 46c6489850ca9029bb75d17ed652563fc58a0082 (patch) | |
tree | 9da1be068dbcc52038b7c5356be86fbdfa9e91b8 /Utilities/Sphinx | |
parent | ada0bc21f42e25882ddf5a8aab10eaf3ea7e0b89 (diff) | |
parent | 30abf145fd48f50c26ee7553fd2512e59be97f25 (diff) | |
download | CMake-46c6489850ca9029bb75d17ed652563fc58a0082.zip CMake-46c6489850ca9029bb75d17ed652563fc58a0082.tar.gz CMake-46c6489850ca9029bb75d17ed652563fc58a0082.tar.bz2 |
Merge topic 'sphinx-1.4'
30abf145 Help: Fix cmake code block warnings produced by Sphinx 1.4
97917900 Utilities/Sphinx: Port qthelp css workaround to Sphinx 1.4
971384c2 Utilities/Sphinx: Port cmake extension to Sphinx 1.4
Diffstat (limited to 'Utilities/Sphinx')
-rw-r--r-- | Utilities/Sphinx/apply_qthelp_css_workaround.cmake | 14 | ||||
-rw-r--r-- | Utilities/Sphinx/cmake.py | 8 |
2 files changed, 15 insertions, 7 deletions
diff --git a/Utilities/Sphinx/apply_qthelp_css_workaround.cmake b/Utilities/Sphinx/apply_qthelp_css_workaround.cmake index 8b74d12..288f370 100644 --- a/Utilities/Sphinx/apply_qthelp_css_workaround.cmake +++ b/Utilities/Sphinx/apply_qthelp_css_workaround.cmake @@ -1,11 +1,15 @@ file(READ "${CSS_DIR}/basic.css" BasicCssContent) -file(READ "${CSS_DIR}/default.css" DefaultCssContent) -string(REPLACE - "@import url(\"basic.css\")" "${BasicCssContent}" - DefaultCssContent "${DefaultCssContent}" -) +if(EXISTS "${CSS_DIR}/default.css") + file(READ "${CSS_DIR}/default.css" DefaultCssContent) + string(REPLACE + "@import url(\"basic.css\")" "${BasicCssContent}" + DefaultCssContent "${DefaultCssContent}" + ) +else() + set(DefaultCssContent "${BasicCssContent}") +endif() file(READ "${CSS_DIR}/cmake.css" CMakeCssContent) string(REPLACE 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'), |