From a7f6e527539b4c015eea699a662d7cea2506e75b Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 21 Sep 2012 06:15:20 +0000 Subject: [PATCH] Check usability of sphynx before declaring it OK. --- salome_adm/cmake_files/FindSPHINX.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/salome_adm/cmake_files/FindSPHINX.cmake b/salome_adm/cmake_files/FindSPHINX.cmake index 354b8194d..b8f972b17 100755 --- a/salome_adm/cmake_files/FindSPHINX.cmake +++ b/salome_adm/cmake_files/FindSPHINX.cmake @@ -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) -- 2.39.2