# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseSphinx)
+# INCLUDE(UseSphinx)
+find_program(SPHINX_EXECUTABLE
+ NAMES sphinx-build
+ DOC "Sphinx Documentation Builder (sphinx-doc.org)"
+)
+
+if (NOT SPHINX_EXECUTABLE)
+ message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
+endif()
SALOME_CONFIGURE_FILE(conf.py.in conf.py)
-IF(MEDCOUPLING_BUILD_FRENCH_DOC)
- SET(BUILD_LANGUAGE_SWITCHER "true")
- SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js)
- ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html LANGUAGES fr)
-ELSE()
- SET(BUILD_LANGUAGE_SWITCHER "false")
- SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js)
- ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html)
-ENDIF()
+# IF(MEDCOUPLING_BUILD_FRENCH_DOC)
+# SET(BUILD_LANGUAGE_SWITCHER "true")
+# SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js)
+# ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html LANGUAGES fr)
+# ELSE()
+# SET(BUILD_LANGUAGE_SWITCHER "false")
+# SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js)
+# ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html)
+# ENDIF()
+
+add_custom_target(usr_doc
+ COMMAND ${SPHINX_EXECUTABLE}
+ -c ${CMAKE_CURRENT_BINARY_DIR}
+ -b html
+ ${CMAKE_CURRENT_BINARY_DIR}/html
+ DEPENDS dev_docs
+ COMMENT "sphinx-build html user-doc"
+ VERBATIM
+)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_doc)")
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${MEDCOUPLING_INSTALL_DOC}/user)
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.mathjax']
+extensions = ['sphinx.ext.mathjax', "breathe"]
try:
import sphinx_rtd_theme
extensions += ['sphinx_rtd_theme']
except:
use_rtd_theme = False
+
# Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates']
templates_path = [os.path.join('@CMAKE_CURRENT_SOURCE_DIR@','templates')]
# Output file base name for HTML help builder.
htmlhelp_basename = 'MEDCouplingUsersGuide'
+###################
+# BREATHE OPTIONS #
+###################
+
+breathe_projects = {"dev_docs": "../developer/xml/"}
+
# Options for LaTeX output
# ------------------------