]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
0023548: [CEA] Generation of documentation is broken if sphinxcontrib.napolen extensi...
authorvsr <vsr@opencascade.com>
Fri, 20 Apr 2018 08:24:58 +0000 (11:24 +0300)
committervsr <vsr@opencascade.com>
Fri, 20 Apr 2018 08:24:58 +0000 (11:24 +0300)
cmake/FindSphinx.cmake

index 09d70a1ebbebde5f0814f938b35e73a84f18a3e7..668888327ca2ca6c922eb8f03b470f8cf59d79e5 100644 (file)
@@ -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()