# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SALOME_CONFIGURE_FILE(conf.py.in conf.py)
-SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/html)
-EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} ${_cmd_options})
-ADD_CUSTOM_TARGET(html_docs COMMAND ${_cmd})
+IF(NOT WIN32)
-INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs)")
-INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/JOBMANAGER)
+ SALOME_CONFIGURE_FILE(conf.py.in conf.py)
-SET(make_clean_files html doctrees)
-SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
+ SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} html)
+ SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}")
+ ADD_CUSTOM_TARGET(html_docs COMMAND ${_cmd})
+
+ INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs)")
+ INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/JOBMANAGER)
+
+ SET(make_clean_files html doctrees)
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
+
+ELSE
+
+ SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/html)
+ EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} ${_cmd_options})
+
+ENDIF
+