diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-01 14:44:41 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-01 14:44:41 -0700 |
commit | c6799c5fbec9a276bc6dafd837d7b0e808699c9a (patch) | |
tree | 7206e2bfe7c9db9b8e40f6e173f3fc7a793c3858 /docs/CMakeLists.txt | |
parent | 1e016375166a23e259abd34a0c30cdbf5c3d119b (diff) | |
parent | e95ecfc467997f831a664342acda5f911e43379f (diff) |
Merge pull request #220 from fhahn/sphinx-docs
Documentation using sphinx
Diffstat (limited to 'docs/CMakeLists.txt')
-rw-r--r-- | docs/CMakeLists.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 00000000..14126cfd --- /dev/null +++ b/docs/CMakeLists.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | # cmake should not fail if sphinx is missing | ||
2 | find_package(Sphinx) | ||
3 | |||
4 | if(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") | ||
35 | else() | ||
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") | ||
40 | endif() | ||