summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2013-08-01 22:30:59 +0200
committerFlorian Hahn <flo@fhahn.com>2013-08-01 22:30:59 +0200
commit95e0eadd674a26779f86aac8f1a6882360300422 (patch)
treee3e03ee19ac59a10f8895cd4022898e2db77dba0
parent2b8bb6304e20c3fee452d21099956af1e60e726d (diff)
Sphinx is not required for building any more
-rw-r--r--docs/CMakeLists.txt69
1 files changed, 39 insertions, 30 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 6b0c9260..14126cfd 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -1,31 +1,40 @@
1find_package(Sphinx REQUIRED) 1# cmake should not fail if sphinx is missing
2 2find_package(Sphinx)
3if(NOT DEFINED SPHINX_THEME) 3
4 set(SPHINX_THEME default) 4if(SPHINX_EXECUTABLE)
5
6 if(NOT DEFINED SPHINX_THEME)
7 set(SPHINX_THEME default)
8 endif()
9
10 if(NOT DEFINED SPHINX_THEME_DIR)
11 set(SPHINX_THEME_DIR)
12 endif()
13
14 # configured documentation tools and intermediate build results
15 set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
16
17 # Sphinx cache with pickled ReST documents
18 set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
19
20 # HTML output directory
21 set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
22
23 configure_file(
24 "${CMAKE_CURRENT_SOURCE_DIR}/conf.py"
25 "${BINARY_BUILD_DIR}/conf.py"
26 @ONLY)
27
28 add_custom_target(docs
29 ${SPHINX_EXECUTABLE}
30 -b html
31 -c "${BINARY_BUILD_DIR}"
32 "${CMAKE_CURRENT_SOURCE_DIR}"
33 "${SPHINX_HTML_DIR}"
34 COMMENT "Building HTML documentation with Sphinx")
35else()
36 add_custom_target(docs
37 echo
38 "Please install python-sphinx to build the docs or read the docs online: https://projecttox.readthedocs.org/en/latest"
39 COMMENT "No sphinx executebale found")
5endif() 40endif()
6
7if(NOT DEFINED SPHINX_THEME_DIR)
8 set(SPHINX_THEME_DIR)
9endif()
10
11# configured documentation tools and intermediate build results
12set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
13
14# Sphinx cache with pickled ReST documents
15set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
16
17# HTML output directory
18set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
19
20configure_file(
21 "${CMAKE_CURRENT_SOURCE_DIR}/conf.py"
22 "${BINARY_BUILD_DIR}/conf.py"
23 @ONLY)
24
25add_custom_target(docs
26 ${SPHINX_EXECUTABLE}
27 -b html
28 -c "${BINARY_BUILD_DIR}"
29 "${CMAKE_CURRENT_SOURCE_DIR}"
30 "${SPHINX_HTML_DIR}"
31 COMMENT "Building HTML documentation with Sphinx")