mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
c123864372
- Using Ceres_[SOURCE/BINARY]_DIR (which are defined by CMake when project(Ceres) is called, in favour of CMAKE_[SOURCE/BINARY]_DIR enables Ceres to be nested within (and built by) a larger CMake project (which also contains other projects). - CMAKE_[SOURCE/BINARY]_DIR always refers to the top-level source and binary directories (i.e. the first encountered), as a result if Ceres is a nested project within a larger project, these would not correctly identify the source/binary directories for Ceres (as they would refer to the root project in which Ceres is nested). - Using Ceres_[SOURCE/BINARY]_DIR should ensure that Ceres always uses the correct source/binary directories, irrespective of whether Ceres is nested or not. Change-Id: I62226ea3f6552b1d7e2bdac1aef02f1f489ae55e
20 lines
641 B
CMake
20 lines
641 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}/*")
|
|
|
|
# Building using 'make_docs.py' python script
|
|
add_custom_target(ceres_docs ALL
|
|
python
|
|
"${Ceres_SOURCE_DIR}/scripts/make_docs.py"
|
|
"${Ceres_SOURCE_DIR}"
|
|
"${Ceres_BINARY_DIR}/docs"
|
|
"${SPHINX_EXECUTABLE}"
|
|
COMMENT "Building HTML documentation with Sphinx")
|