From 242f704e94de4236de1b1023edded874c0faf070 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 12 Aug 2020 13:29:40 +0300 Subject: [PATCH] Make the documentation compilable on Windows --- CMakeCommon/FindSphinx.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeCommon/FindSphinx.cmake b/CMakeCommon/FindSphinx.cmake index c719da855..bfd7a9acf 100644 --- a/CMakeCommon/FindSphinx.cmake +++ b/CMakeCommon/FindSphinx.cmake @@ -45,6 +45,13 @@ INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE) IF(SPHINX_EXECUTABLE) + IF(WIN32) + # Call Sphinx through the Python executable to eliminate the problem related to starting the Sphinx's process. + GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${SPHINX_EXECUTABLE}" PATH) + GET_FILENAME_COMPONENT(_tmp_FILENAME "${SPHINX_EXECUTABLE}" NAME_WE) + SET(SPHINX_EXECUTABLE "${PYTHON_EXECUTABLE}" "${_tmp_ROOT_DIR}/${_tmp_FILENAME}-script.py") + ENDIF() + 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}") -- 2.39.2