From 18ce14653647a93319cc53eec9bc310d3a4c6f57 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Tue, 20 Apr 2021 23:10:38 +0200 Subject: [PATCH] Split C++ API docs from general docs (#6365) --- docs/CMakeLists.txt | 30 ++-------------- docs/cpp.rst | 72 -------------------------------------- docs/cpp/CMakeLists.txt | 48 +++++++++++++++++++++++++ docs/{ => cpp}/Doxyfile.in | 0 docs/cpp/cpp.rst | 72 ++++++++++++++++++++++++++++++++++++++ docs/index.rst | 2 +- 6 files changed, 124 insertions(+), 100 deletions(-) delete mode 100644 docs/cpp.rst create mode 100644 docs/cpp/CMakeLists.txt rename docs/{ => cpp}/Doxyfile.in (100%) create mode 100644 docs/cpp/cpp.rst diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 01d7aed65..2890148b7 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -12,44 +12,20 @@ # # The build system configuration. ## -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 - ${PROJECT_SOURCE_DIR}/src/api/cpp/cvc5_kind.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}) +add_subdirectory(cpp) 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 + DEPENDS docs-cpp COMMAND ${SPHINX_EXECUTABLE} -b html # Tell Breathe where to find the Doxygen output - -Dbreathe_projects.cvc5=${DOXYGEN_OUTPUT_DIR}/xml + -Dbreathe_projects.cvc5=${CPP_DOXYGEN_XML_FOLDER} ${SPHINX_INPUT_DIR} ${SPHINX_OUTPUT_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating Sphinx Api docs") diff --git a/docs/cpp.rst b/docs/cpp.rst deleted file mode 100644 index 413524078..000000000 --- a/docs/cpp.rst +++ /dev/null @@ -1,72 +0,0 @@ -C++ API Documentation -===================== - -Class Hierarchy ---------------- - -* namespace ``cvc5`` - - * namespace ``api`` - - * class :cpp:class:`cvc5::api::CVC4ApiException` - - * class :cpp:class:`cvc5::api::CVC4ApiRecoverableException` - - * class :doc:`cpp/datatype` - - * class :ref:`Datatype::const_iterator` - - * class :doc:`cpp/datatypeconstructor` - - * class :ref:`DatatypeConstructor::const_iterator` - - * class :doc:`cpp/datatypeconstructordecl` - - * class :doc:`cpp/datatypedecl` - - * class :doc:`cpp/datatypeselector` - - * class :doc:`cpp/grammar` - - * class :doc:`cpp/op` - - * class :doc:`cpp/result` - - * class :doc:`cpp/solver` - - * class :doc:`cpp/term` - - * class :ref:`Term::const_iterator` - - * enum :doc:`cpp/kind` - - * enum :doc:`cpp/roundingmode` - - * struct :ref:`KindHashFunction` - - * struct :ref:`OpHashFunction` - - * struct :ref:`SortHashFunction` - - - -Full API Documentation ----------------------- - -.. toctree:: - :maxdepth: 2 - - cpp/datatype - cpp/datatypeconstructor - cpp/datatypeconstructordecl - cpp/datatypedecl - cpp/datatypeselector - cpp/exceptions - cpp/grammar - cpp/kind - cpp/op - cpp/result - cpp/roundingmode - cpp/solver - cpp/sort - cpp/term diff --git a/docs/cpp/CMakeLists.txt b/docs/cpp/CMakeLists.txt new file mode 100644 index 000000000..3b5da30b6 --- /dev/null +++ b/docs/cpp/CMakeLists.txt @@ -0,0 +1,48 @@ +############################################################################### +# Top contributors (to current version): +# Aina Niemetz +# +# This file is part of the cvc5 project. +# +# Copyright (c) 2009-2021 by the authors listed in the file AUTHORS +# in the top-level source directory and their institutional affiliations. +# All rights reserved. See the file COPYING in the top-level source +# directory for licensing information. +# ############################################################################# +# +# The build system configuration. +# +find_package(Doxygen REQUIRED) + +# basic parameters +set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src/api/cpp) +set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/cpp-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) + +# create doxygen config file +set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) +set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY) + +# make sure the outpur directory exists +file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) + +# add the cpp-doxygen target +add_custom_command( + OUTPUT ${DOXYGEN_INDEX_FILE} + COMMAND Doxygen::doxygen ${DOXYFILE_OUT} + MAIN_DEPENDENCY ${DOXYFILE_OUT} + DEPENDS ${PROJECT_SOURCE_DIR}/src/api/cpp/cvc5.h + ${PROJECT_SOURCE_DIR}/src/api/cpp/cvc5_kind.h + COMMENT "Generating doxygen API docs" +) +add_custom_target(docs-cpp ALL DEPENDS ${DOXYGEN_INDEX_FILE}) + +# tell parent scope where to find the output xml +set(CPP_DOXYGEN_XML_FOLDER + "${DOXYGEN_OUTPUT_DIR}/xml" + PARENT_SCOPE +) diff --git a/docs/Doxyfile.in b/docs/cpp/Doxyfile.in similarity index 100% rename from docs/Doxyfile.in rename to docs/cpp/Doxyfile.in diff --git a/docs/cpp/cpp.rst b/docs/cpp/cpp.rst new file mode 100644 index 000000000..86b310d6e --- /dev/null +++ b/docs/cpp/cpp.rst @@ -0,0 +1,72 @@ +C++ API Documentation +===================== + +Class Hierarchy +--------------- + +* namespace ``cvc5`` + + * namespace ``api`` + + * class :cpp:class:`cvc5::api::CVC4ApiException` + + * class :cpp:class:`cvc5::api::CVC4ApiRecoverableException` + + * class :doc:`datatype` + + * class :ref:`Datatype::const_iterator` + + * class :doc:`datatypeconstructor` + + * class :ref:`DatatypeConstructor::const_iterator` + + * class :doc:`datatypeconstructordecl` + + * class :doc:`datatypedecl` + + * class :doc:`datatypeselector` + + * class :doc:`grammar` + + * class :doc:`op` + + * class :doc:`result` + + * class :doc:`solver` + + * class :doc:`term` + + * class :ref:`Term::const_iterator` + + * enum :doc:`kind` + + * enum :doc:`roundingmode` + + * struct :ref:`KindHashFunction` + + * struct :ref:`OpHashFunction` + + * struct :ref:`SortHashFunction` + + + +Full API Documentation +---------------------- + +.. toctree:: + :maxdepth: 2 + + datatype + datatypeconstructor + datatypeconstructordecl + datatypedecl + datatypeselector + exceptions + grammar + kind + op + result + roundingmode + solver + sort + term diff --git a/docs/index.rst b/docs/index.rst index 7167d7230..71fed0356 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,6 +15,6 @@ cvc5 API Documentation .. toctree:: :maxdepth: 2 - cpp + cpp/cpp references examples/examples -- 2.30.2