From f64e49d2e163b9de96ea06d27133cb62ad94db35 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 20 Jan 2016 16:37:15 +0300 Subject: [PATCH] Set-up Sphinx theme depending on its version --- salome_adm/cmake_files/FindSphinx.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) -- 2.39.2