mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
a1c02e8d37
* Make sphinx_rtd_theme a find module component to avoid hard-wiring it into the module and allowing to report the theme in case it is missing using the standard CMake package mechanism. * Adjust find module cache variables names case to match the find module name. * Also report sphinx-build version for completeness. * Invoke the find module only once. Calling find_package on the same module is not needed. Change-Id: I9d1bf0fcc0d44b9b37e624128812f348c5442ada
22 lines
740 B
CMake
22 lines
740 B
CMake
# HTML output directory
|
|
set(SPHINX_HTML_DIR "${Ceres_BINARY_DIR}/docs/html")
|
|
|
|
# Install documentation
|
|
install(DIRECTORY ${SPHINX_HTML_DIR}
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
|
COMPONENT Doc
|
|
PATTERN "${SPHINX_HTML_DIR}/*")
|
|
|
|
# Find python
|
|
find_package(Python REQUIRED COMPONENTS Interpreter)
|
|
|
|
# Building using 'make_docs.py' python script
|
|
add_custom_target(ceres_docs ALL
|
|
$<TARGET_FILE:Python::Interpreter>
|
|
"${Ceres_SOURCE_DIR}/scripts/make_docs.py"
|
|
"${Ceres_SOURCE_DIR}"
|
|
"${Ceres_BINARY_DIR}/docs"
|
|
"${Sphinx_BUILD_EXECUTABLE}"
|
|
USES_TERMINAL
|
|
COMMENT "Building HTML documentation with Sphinx")
|