Merge pull request #1330 from lenlen:plantuml
This commit is contained in:
commit
160ab8415e
@ -840,6 +840,7 @@ if(BUILD_DOCS)
|
|||||||
endif()
|
endif()
|
||||||
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
||||||
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
||||||
|
status(" PlantUML:" PLANTUML THEN "${PLANTUML}" ELSE NO)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ========================== samples and tests ==========================
|
# ========================== samples and tests ==========================
|
||||||
|
@ -78,6 +78,7 @@ endif()
|
|||||||
|
|
||||||
if(BUILD_DOCS)
|
if(BUILD_DOCS)
|
||||||
find_host_program(SPHINX_BUILD sphinx-build)
|
find_host_program(SPHINX_BUILD sphinx-build)
|
||||||
|
find_host_program(PLANTUML plantuml)
|
||||||
if(SPHINX_BUILD)
|
if(SPHINX_BUILD)
|
||||||
execute_process(COMMAND "${SPHINX_BUILD}"
|
execute_process(COMMAND "${SPHINX_BUILD}"
|
||||||
OUTPUT_QUIET
|
OUTPUT_QUIET
|
||||||
|
@ -67,9 +67,14 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
|||||||
set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT}
|
set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT}
|
||||||
${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT})
|
${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT})
|
||||||
|
|
||||||
|
set(BUILD_PLANTUML "")
|
||||||
|
if(PLANTUML)
|
||||||
|
set(BUILD_PLANTUML "-tplantuml")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(PDFLATEX_COMPILER)
|
if(PDFLATEX_COMPILER)
|
||||||
add_custom_target(docs
|
add_custom_target(docs
|
||||||
COMMAND ${SPHINX_BUILD} -b latex -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. .
|
COMMAND ${SPHINX_BUILD} ${BUILD_PLANTUML} -b latex -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. .
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex
|
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex
|
||||||
@ -103,7 +108,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_target(html_docs
|
add_custom_target(html_docs
|
||||||
COMMAND ${SPHINX_BUILD} -b html -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ./_html
|
COMMAND ${SPHINX_BUILD} ${BUILD_PLANTUML} -b html -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ./_html
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
DEPENDS ${OPENCV_DOC_DEPS}
|
DEPENDS ${OPENCV_DOC_DEPS}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
13
doc/conf.py
13
doc/conf.py
@ -28,6 +28,16 @@ sys.path.insert(0, os.path.abspath('.'))
|
|||||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||||
extensions = ['sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.todo', 'sphinx.ext.extlinks', 'ocv', 'sphinx.ext.doctest']
|
extensions = ['sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.todo', 'sphinx.ext.extlinks', 'ocv', 'sphinx.ext.doctest']
|
||||||
|
|
||||||
|
have_plantuml_ext = False
|
||||||
|
if tags.has('plantuml'):
|
||||||
|
try:
|
||||||
|
import sphinxcontrib.plantuml
|
||||||
|
extensions.append("sphinxcontrib.plantuml")
|
||||||
|
have_plantuml_ext = True
|
||||||
|
except ImportError:
|
||||||
|
print "No module sphinxcontrib.plantuml found, sphinx will not render UML diagrams"
|
||||||
|
|
||||||
doctest_test_doctest_blocks = 'block'
|
doctest_test_doctest_blocks = 'block'
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
@ -79,6 +89,9 @@ release += version_status
|
|||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
exclude_patterns = ['doc/tutorials/definitions']
|
exclude_patterns = ['doc/tutorials/definitions']
|
||||||
|
|
||||||
|
if not have_plantuml_ext:
|
||||||
|
exclude_patterns.append('**/uml/*')
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||||
#default_role = None
|
#default_role = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user