]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Check usability of sphynx before declaring it OK.
authorageay <ageay>
Fri, 21 Sep 2012 06:15:20 +0000 (06:15 +0000)
committerageay <ageay>
Fri, 21 Sep 2012 06:15:20 +0000 (06:15 +0000)
salome_adm/cmake_files/FindSPHINX.cmake

index 354b8194de512c6084c68a7d844576abfd4836f1..b8f972b17fa680d7c75326f1f8c73136de10156c 100755 (executable)
@@ -75,7 +75,14 @@ IF(SPHINX_STATUS)
     FIND_PROGRAM(SPHINX_EXECUTABLE ${SPHINX_EXECUTABLE_TO_FIND})
   ENDIF(SPHINX_ROOT_USER)
   IF(SPHINX_EXECUTABLE)
-    MESSAGE(STATUS "${SPHINX_EXECUTABLE_TO_FIND} found: ${SPHINX_EXECUTABLE}")
+    EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} -v ERROR_VARIABLE STATUS_CHECK_SPHINX)
+    STRING(REGEX MATCH "^Sphinx v[0-9]+\\.[0-9]+\\.[0-9]+" IS_SPHINX_USABLE ${STATUS_CHECK_SPHINX})
+    IF(IS_SPHINX_USABLE)
+      MESSAGE(STATUS "${SPHINX_EXECUTABLE_TO_FIND} found: ${SPHINX_EXECUTABLE}")
+    ELSE(IS_SPHINX_USABLE)
+      MESSAGE(STATUS "${SPHINX_EXECUTABLE_TO_FIND} found but NOT usable ! Check coherency between your python and Sphinx ! Sphinx DISABLED !")
+      SET(SPHINX_STATUS 0)
+    ENDIF(IS_SPHINX_USABLE)
   ELSE(SPHINX_EXECUTABLE)
     MESSAGE(STATUS "${SPHINX_EXECUTABLE_TO_FIND} not found, try to use WITH_SPHINX option or SPHINX_ROOT (or SPHINXHOME) environment variable")
     SET(SPHINX_STATUS 0)