Redo the Sphinx check to do the same thing on all platforms.
This also fixes the bug where the Sphinx version gets detected as "Sphinx vX.Y.Z" instead of "X.Y.Z" on Unix-like systems.
This commit is contained in:
parent
f6848b66d6
commit
bd6f80faf3
@ -104,18 +104,12 @@ if(PYTHON_EXECUTABLE)
|
|||||||
if(BUILD_DOCS)
|
if(BUILD_DOCS)
|
||||||
find_host_program(SPHINX_BUILD sphinx-build)
|
find_host_program(SPHINX_BUILD sphinx-build)
|
||||||
if(SPHINX_BUILD)
|
if(SPHINX_BUILD)
|
||||||
if(UNIX)
|
execute_process(COMMAND "${SPHINX_BUILD}"
|
||||||
execute_process(COMMAND sh -c "${SPHINX_BUILD} -_ 2>&1 | sed -ne 1p"
|
OUTPUT_QUIET
|
||||||
RESULT_VARIABLE SPHINX_PROCESS
|
ERROR_VARIABLE SPHINX_OUTPUT
|
||||||
OUTPUT_VARIABLE SPHINX_VERSION
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
if(SPHINX_OUTPUT MATCHES "^Sphinx v([0-9][^ \n]*)")
|
||||||
else()
|
set(SPHINX_VERSION "${CMAKE_MATCH_1}")
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sphinx; print sphinx.__version__"
|
|
||||||
RESULT_VARIABLE SPHINX_PROCESS
|
|
||||||
OUTPUT_VARIABLE SPHINX_VERSION
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
endif()
|
|
||||||
if(SPHINX_PROCESS EQUAL 0)
|
|
||||||
set(HAVE_SPHINX 1)
|
set(HAVE_SPHINX 1)
|
||||||
message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
|
message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user