summaryrefslogtreecommitdiff
path: root/docs/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/CMakeLists.txt')
-rw-r--r--docs/CMakeLists.txt72
1 files changed, 35 insertions, 37 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 14126cfd..4b281eb4 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -1,40 +1,38 @@
1# cmake should not fail if sphinx is missing 1find_package(Sphinx QUIET)
2find_package(Sphinx)
3 2
4if(SPHINX_EXECUTABLE) 3if(NOT DEFINED SPHINX_THEME)
5 4 set(SPHINX_THEME default)
6 if(NOT DEFINED SPHINX_THEME) 5endif()
7 set(SPHINX_THEME default) 6
8 endif() 7if(NOT DEFINED SPHINX_THEME_DIR)
9 8 set(SPHINX_THEME_DIR)
10 if(NOT DEFINED SPHINX_THEME_DIR) 9endif()
11 set(SPHINX_THEME_DIR) 10
12 endif() 11# configured documentation tools and intermediate build results
13 12set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
14 # configured documentation tools and intermediate build results 13
15 set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") 14# Sphinx cache with pickled ReST documents
16 15set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
17 # Sphinx cache with pickled ReST documents 16
18 set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") 17# HTML output directory
19 18set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
20 # HTML output directory 19
21 set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") 20configure_file(
22 21 "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
23 configure_file( 22 "${BINARY_BUILD_DIR}/conf.py"
24 "${CMAKE_CURRENT_SOURCE_DIR}/conf.py" 23 @ONLY)
25 "${BINARY_BUILD_DIR}/conf.py" 24
26 @ONLY) 25if(SPHINX_FOUND)
27 26 add_custom_target(docs
28 add_custom_target(docs 27 ${SPHINX_EXECUTABLE}
29 ${SPHINX_EXECUTABLE} 28 -b html
30 -b html 29 -c "${BINARY_BUILD_DIR}"
31 -c "${BINARY_BUILD_DIR}" 30 -d "${SPHINX_CACHE_DIR}"
32 "${CMAKE_CURRENT_SOURCE_DIR}" 31 "${CMAKE_CURRENT_SOURCE_DIR}"
33 "${SPHINX_HTML_DIR}" 32 "${SPHINX_HTML_DIR}"
34 COMMENT "Building HTML documentation with Sphinx") 33 COMMENT "Building HTML documentation with Sphinx")
35else() 34else()
36 add_custom_target(docs 35 add_custom_target(docs
37 echo 36 echo "Please install python-sphinx to build the docs or read the docs online: https://projecttox.readthedocs.org/en/latest"
38 "Please install python-sphinx to build the docs or read the docs online: https://projecttox.readthedocs.org/en/latest" 37- COMMENT "No sphinx executable found")
39 COMMENT "No sphinx executebale found")
40endif() 38endif()