diff options
-rw-r--r-- | Modules/FindBoost.cmake | 2 | ||||
-rw-r--r-- | Modules/FindJava.cmake | 2 | ||||
-rw-r--r-- | Utilities/Sphinx/cmake.py | 17 |
3 files changed, 18 insertions, 3 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index cc273e0..b4abf75 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -244,6 +244,8 @@ if (NOT Boost_NO_BOOST_CMAKE) message("Found Boost components:") message(" ${Boost_FIND_COMPONENTS}") endif() + # Restore project's policies + cmake_policy(POP) return() endif() endif() diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index 23f707a..eb2242b 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -143,7 +143,7 @@ if(Java_JAVA_EXECUTABLE) if(var MATCHES "java version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\"") # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer set(Java_VERSION_STRING "${CMAKE_MATCH_1}") - elseif(var MATCHES "openjdk version \"([0-9]+)-[a-z]+\"") + elseif(var MATCHES "openjdk version \"([0-9]+)-[A-Za-z]+\"") # OpenJDK 9 early access builds or locally built set(Java_VERSION_STRING "1.${CMAKE_MATCH_1}.0") elseif(var MATCHES "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+)\"") diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index 6f273f9..cfda2d4 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -46,7 +46,20 @@ 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, version_info +from sphinx import addnodes + +# Needed for checking if Sphinx version is >= 1.4. +# See https://github.com/sphinx-doc/sphinx/issues/2673 +old_sphinx = False + +try: + from sphinx import version_info + if version_info < (1, 4): + old_sphinx = True +except ImportError: + # The `sphinx.version_info` tuple was added in Sphinx v1.2: + old_sphinx = True + class CMakeModule(Directive): required_arguments = 1 @@ -124,7 +137,7 @@ class _cmake_index_entry: def __call__(self, title, targetid, main = 'main'): # See https://github.com/sphinx-doc/sphinx/issues/2673 - if version_info < (1, 4): + if old_sphinx: return ('pair', u'%s ; %s' % (self.desc, title), targetid, main) else: return ('pair', u'%s ; %s' % (self.desc, title), targetid, main, None) |