summaryrefslogtreecommitdiff
path: root/docs/CMakeLists.txt
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2021-04-07 12:15:31 -0700
committerGitHub <noreply@github.com>2021-04-07 19:15:31 +0000
commit887a75715761767bb7fd7b1d71e188399a4edd3b (patch)
treeaf6e47920d9443915ba8a97d12c7607a3ca7759c /docs/CMakeLists.txt
parent04a494e251a8cc2c90bb429e2858f1c4eb8f88ff (diff)
New C++ Api: Initial setup of Api documentation. (#6295)
This configures the initial setup for generating Api documentation with Sphinx via Breathe and Doxygen. All fixes in the documentation of the cvc5.h header are for the purpose of eliminating warnings. This PR does not check for completeness of the documentation, and does not yet tweak the documentation to be nice, beautiful and consistent, which is postponed to future PRs. Configure with `--docs`, and then make. This will generate a `docs` directory in the build directory. The Sphinx documentation can be found at `build/docs/sphinx/index.html`. Doxygen documentation is only generated as xml under `build/docs/doxygen`. This PR further proposes a new style for copyright headers. If this style is approved, I will submit a PR to update the update_copyright.pl script.
Diffstat (limited to 'docs/CMakeLists.txt')
-rw-r--r--docs/CMakeLists.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 000000000..1baa0f6d4
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,39 @@
+find_package(Doxygen REQUIRED)
+find_package(Sphinx REQUIRED)
+check_python_module(breathe)
+
+set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
+set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src/api/cpp)
+set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
+set(DOXYGEN_INPUT
+ "${DOXYGEN_INPUT_DIR}/cvc5.h ${DOXYGEN_INPUT_DIR}/cvc5_kind.h")
+set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/xml/index.xml)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
+
+file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})
+
+add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
+ DEPENDS ${PROJECT_SOURCE_DIR}/src/api/cpp/cvc5.h
+ COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
+ WORKING_DIRECTORY ${DOXYGEN_BIN_DIR}
+ MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
+ COMMENT "Generating doxygen API docs")
+
+add_custom_target(docs-doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE})
+
+set(SPHINX_INPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(SPHINX_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
+
+add_custom_target(docs ALL
+ DEPENDS docs-doxygen
+ COMMAND
+ ${SPHINX_EXECUTABLE} -b html
+ # Tell Breathe where to find the Doxygen output
+ -Dbreathe_projects.cvc5=${DOXYGEN_OUTPUT_DIR}/xml
+ ${SPHINX_INPUT_DIR} ${SPHINX_OUTPUT_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generating Sphinx Api docs")
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback