From: vsr Date: Fri, 20 Apr 2018 08:24:58 +0000 (+0300) Subject: 0023548: [CEA] Generation of documentation is broken if sphinxcontrib.napolen extensi... X-Git-Tag: V8_5_0rc1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=431d25821b813549148bc9e9c321b17de7d7f0f8;p=tools%2Fconfiguration.git 0023548: [CEA] Generation of documentation is broken if sphinxcontrib.napolen extension is not available --- diff --git a/cmake/FindSphinx.cmake b/cmake/FindSphinx.cmake index 09d70a1..6688883 100644 --- a/cmake/FindSphinx.cmake +++ b/cmake/FindSphinx.cmake @@ -2,8 +2,16 @@ # # Output variables: # SPHINX_EXECUTABLE - path to the Sphinx executable -# SPHINX_PYTHONPATH - path to the Sphinx Python modules -# +# SPHINX_PYTHONPATH - path to the Sphinx Python modules +# +# Additional features: +# Sphinx_EXTENSIONS - optional variable which can be used to specify +# a list of required Sphinx extensions; not found +# extensions will be reported during the detection +# procedure; by default this variable is empty. +# Example: +# set(Sphinx_EXTENSIONS sphinxcontrib.napoleon) +# ########################################################################### # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # @@ -61,3 +69,12 @@ IF(SPHINX_EXECUTABLE) SET(SPHINX_THEME "classic") ENDIF() ENDIF(SPHINX_EXECUTABLE) + +FOREACH(_ext ${Sphinx_EXTENSIONS}) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import ${_ext}; print 'ok'" OUTPUT_VARIABLE _has_ext ERROR_QUIET) + IF(_has_ext) + MESSAGE(STATUS "Required Sphinx extension '${_ext}' has been found!") + ELSE() + MESSAGE(WARNING "Required Sphinx extension '${_ext}' is not found!") + ENDIF() +ENDFOREACH()