1 ###############################################################################
2 # Top contributors (to current version):
5 # This file is part of the cvc5 project.
7 # Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 # in the top-level source directory and their institutional affiliations.
9 # All rights reserved. See the file COPYING in the top-level source
10 # directory for licensing information.
11 # #############################################################################
13 # The build system configuration.
15 find_package(Sphinx REQUIRED)
16 check_python_module(breathe)
17 check_python_module(sphinxcontrib.bibtex sphinxcontrib-bibtex)
18 check_python_module(sphinx_tabs.tabs sphinx-tabs)
19 check_python_module(sphinxcontrib.programoutput sphinxcontrib.programoutput)
23 set(SPHINX_INPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
24 set(SPHINX_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
26 configure_file(conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py)
30 DEPENDS docs-cpp docs-java docs-python gen-options cvc5-bin
32 ${SPHINX_EXECUTABLE} -v -b html -c ${CMAKE_CURRENT_BINARY_DIR}
33 # Tell Breathe where to find the Doxygen output
34 -Dbreathe_projects.cvc5=${CPP_DOXYGEN_XML_DIR}
35 -Dbreathe_projects.std=${CPP_DOXYGEN_XML_DIR} ${SPHINX_INPUT_DIR}
37 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
38 COMMENT "Generating Sphinx Api docs"
45 ${CMAKE_COMMAND} -E cmake_echo_color --cyan "Preview docs in browser: file://localhost${SPHINX_OUTPUT_DIR}/index.html"
48 set(SPHINX_GH_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/sphinx-gh)
52 # remove existing sphinx-gh/ directory
53 COMMAND ${CMAKE_COMMAND} -E remove_directory ${SPHINX_GH_OUTPUT_DIR}
54 # copy sphinx/ to sphinx-gh/
55 COMMAND ${CMAKE_COMMAND} -E copy_directory ${SPHINX_OUTPUT_DIR}
56 ${SPHINX_GH_OUTPUT_DIR}
57 # remove leftovers from the build
58 COMMAND ${CMAKE_COMMAND} -E remove_directory ${SPHINX_GH_OUTPUT_DIR}/.doctrees
59 ${SPHINX_GH_OUTPUT_DIR}/_sources ${SPHINX_GH_OUTPUT_DIR}/_static/fonts
60 COMMAND ${CMAKE_COMMAND} -E remove ${SPHINX_GH_OUTPUT_DIR}/objects.inv
61 # rename _static/ to static/ (as jekyll ignores _*/ dirs)
62 COMMAND ${CMAKE_COMMAND} -E rename ${SPHINX_GH_OUTPUT_DIR}/_static
63 ${SPHINX_GH_OUTPUT_DIR}/static
64 COMMAND find ${SPHINX_GH_OUTPUT_DIR} -type f | xargs sed -i'orig'
66 COMMAND find ${SPHINX_GH_OUTPUT_DIR} -name '*orig' -delete
68 COMMENT "Generating GitHub Api docs"