ELSE()
SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
ENDIF()
+
# Handle the standard arguments of the find_package() command:
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE)
+IF(SPHINX_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} "--version" OUTPUT_VARIABLE SPHINX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+ STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" )
+ MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}")
+ IF(SPHINX_VERSION VERSION_LESS "1.3")
+ SET(SPHINX_THEME "basic")
+ ELSE()
+ SET(SPHINX_THEME "classic")
+ ENDIF()
+ENDIF(SPHINX_EXECUTABLE)