This PR makes cmake generate the sphinx configuration file. This will simplify dynamically modifying this file in the future, for example to add custom paths within the build directory (for the python API).
set(SPHINX_INPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SPHINX_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
+configure_file(conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py)
+
add_custom_target(docs ALL
DEPENDS docs-cpp
COMMAND
${SPHINX_EXECUTABLE} -b html
+ -c ${CMAKE_CURRENT_BINARY_DIR}
# Tell Breathe where to find the Doxygen output
-Dbreathe_projects.cvc5=${CPP_DOXYGEN_XML_FOLDER}
${SPHINX_INPUT_DIR} ${SPHINX_OUTPUT_DIR}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating Sphinx Api docs")
set(SPHINX_GH_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/sphinx-gh)
+++ /dev/null
-# Configuration file for the Sphinx documentation builder.
-#
-# This file only contains a selection of the most common options. For a full
-# list see the documentation:
-# https://www.sphinx-doc.org/en/master/usage/configuration.html
-
-# -- Path setup --------------------------------------------------------------
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#
-import os
-import sys
-sys.path.insert(0, os.path.abspath('ext/'))
-
-
-# -- Project information -----------------------------------------------------
-
-project = 'cvc5'
-copyright = '2021, The Authors of cvc5'
-author = 'The Authors of cvc5'
-
-
-# -- General configuration ---------------------------------------------------
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
- 'breathe',
- 'sphinx.ext.autosectionlabel',
- 'sphinxcontrib.bibtex',
- 'sphinx_tabs.tabs',
- 'examples',
-]
-
-bibtex_bibfiles = ['references.bib']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-# This pattern also affects html_static_path and html_extra_path.
-exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
-
-
-# -- Options for HTML output -------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-#
-html_theme = 'sphinx_rtd_theme'
-html_theme_options = {}
-html_static_path = ['_static']
-html_css_files = ['custom.css']
-
-# -- Breathe configuration ---------------------------------------------------
-breathe_default_project = "cvc5"
-breathe_domain_by_extension = {"h" : "cpp"}
--- /dev/null
+# Configuration file for the Sphinx documentation builder.
+#
+# This file only contains a selection of the most common options. For a full
+# list see the documentation:
+# https://www.sphinx-doc.org/en/master/usage/configuration.html
+
+# -- Path setup --------------------------------------------------------------
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+
+import sys
+# add path to enable extensions
+sys.path.insert(0, '${CMAKE_CURRENT_SOURCE_DIR}/ext/')
+
+
+# -- Project information -----------------------------------------------------
+
+project = 'cvc5'
+copyright = '2021, The Authors of cvc5'
+author = 'The Authors of cvc5'
+
+
+# -- General configuration ---------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+ 'breathe',
+ 'sphinx.ext.autosectionlabel',
+ 'sphinxcontrib.bibtex',
+ 'sphinx_tabs.tabs',
+ 'examples',
+]
+
+bibtex_bibfiles = ['references.bib']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path.
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+
+# -- Options for HTML output -------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'sphinx_rtd_theme'
+html_theme_options = {}
+html_static_path = ['${CMAKE_CURRENT_SOURCE_DIR}/_static/']
+html_css_files = ['custom.css']
+
+# -- Breathe configuration ---------------------------------------------------
+breathe_default_project = "cvc5"
+breathe_domain_by_extension = {"h" : "cpp"}