From: vsr Date: Wed, 20 Jan 2016 13:37:15 +0000 (+0300) Subject: Set-up Sphinx theme depending on its version X-Git-Tag: V8_1_0a1~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=292852d010ba82f8a20353f71ea27892627278bd;p=modules%2Fkernel.git Set-up Sphinx theme depending on its version --- diff --git a/salome_adm/cmake_files/FindSphinx.cmake b/salome_adm/cmake_files/FindSphinx.cmake index 1c9c6a8fd..648d1707b 100644 --- a/salome_adm/cmake_files/FindSphinx.cmake +++ b/salome_adm/cmake_files/FindSphinx.cmake @@ -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)