]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make the documentation compilable on Windows
authorazv <azv@opencascade.com>
Wed, 12 Aug 2020 10:29:40 +0000 (13:29 +0300)
committerazv <azv@opencascade.com>
Wed, 12 Aug 2020 10:29:40 +0000 (13:29 +0300)
CMakeCommon/FindSphinx.cmake

index c719da8556ad5a233643ffea17c67e2781cc1d8f..bfd7a9acf6e5d7009738a6a58faeac182cec1c43 100644 (file)
@@ -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}")