From: azv Date: Wed, 12 Aug 2020 10:29:40 +0000 (+0300) Subject: Make the documentation compilable on Windows X-Git-Tag: V9_6_0a1~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=242f704e94de4236de1b1023edded874c0faf070;p=modules%2Fshaper.git Make the documentation compilable on Windows --- 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}")