]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Set-up Sphinx theme depending on its version
authorvsr <vsr@opencascade.com>
Wed, 20 Jan 2016 13:37:15 +0000 (16:37 +0300)
committervsr <vsr@opencascade.com>
Thu, 21 Jan 2016 15:22:21 +0000 (18:22 +0300)
salome_adm/cmake_files/FindSphinx.cmake

index 1c9c6a8fd8f6fff31b5c46f3edc89a25099b84d8..648d1707b98f485420265ff545969d2488fb56ca 100644 (file)
@@ -38,7 +38,18 @@ IF(WIN32)
 ELSE()
   SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
 ENDIF()
+
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE)
 
+IF(SPHINX_EXECUTABLE)
+  EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} "--version" OUTPUT_VARIABLE SPHINX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+  STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" )
+  MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}")
+  IF(SPHINX_VERSION VERSION_LESS "1.3")
+    SET(SPHINX_THEME "basic")
+  ELSE()
+    SET(SPHINX_THEME "classic")
+  ENDIF()
+ENDIF(SPHINX_EXECUTABLE)