Files
ceres-solver/docs/source/CMakeLists.txt
T
Sumit Dey 7de561e8e8 Fix dependency check for building documentation
Build with documentation fails if the required 'sphinx rtd theme' is
not available. Check if dependency is installed before building with
documentation.

Add Python3 as requirement for building documentation.

Change-Id: I5edc5d7374864990e625a5efb358f5a23b3c50fe
2021-07-31 12:21:16 +02:00

23 lines
710 B
CMake

find_package(Sphinx REQUIRED)
# HTML output directory
set(SPHINX_HTML_DIR "${Ceres_BINARY_DIR}/docs/html")
# Install documentation
install(DIRECTORY ${SPHINX_HTML_DIR}
DESTINATION "${CERES_DOCS_INSTALL_DIR}"
COMPONENT Doc
PATTERN "${SPHINX_HTML_DIR}/*")
# Find python 3
find_package(PythonInterp 3 REQUIRED)
# Building using 'make_docs.py' python script
add_custom_target(ceres_docs ALL
${PYTHON_EXECUTABLE}
"${Ceres_SOURCE_DIR}/scripts/make_docs.py"
"${Ceres_SOURCE_DIR}"
"${Ceres_BINARY_DIR}/docs"
"${SPHINX_EXECUTABLE}"
COMMENT "Building HTML documentation with Sphinx")