comparison manuals/CMakeLists.txt @ 933:af27328bea9d

(issue89) Add sphinx integration for the build system.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 22 Aug 2014 17:06:56 +0200
parents
children
comparison
equal deleted inserted replaced
932:57371f2e8dae 933:af27328bea9d
1 # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
2 # Software engineering by Intevation GmbH
3 #
4 # This file is Free Software under the GNU GPL (v>=2)
5 # and comes with ABSOLUTELY NO WARRANTY!
6 # See LICENSE.txt for details.
7
8 if(NOT DEFINED SPHINX_THEME)
9 set(SPHINX_THEME better)
10 endif()
11
12 if(NOT DEFINED SPHINX_THEME_DIR)
13 set(SPHINX_THEME_DIR "${CMAKE_CURRENT_SOURCE_DIR}/theme")
14 endif()
15
16 set(ADMIN_MANUAL_IN "${CMAKE_CURRENT_SOURCE_DIR}/admin-manual")
17 set(ADMIN_MANUAL_OUT "${CMAKE_CURRENT_BINARY_DIR}/admin-manual")
18 set(HELP_MANUAL_IN "${CMAKE_CURRENT_SOURCE_DIR}/help-manual")
19 set(HELP_MANUAL_OUT "${CMAKE_CURRENT_BINARY_DIR}/help-manual")
20
21
22 # configured documentation tools and intermediate build results
23 set(BINARY_BUILD_DIR_ADMIN "${CMAKE_CURRENT_BINARY_DIR}/_build-admin")
24 set(BINARY_BUILD_DIR_HELP "${CMAKE_CURRENT_BINARY_DIR}/_build-help")
25
26 # Sphinx cache with pickled ReST documents
27 set(SPHINX_CACHE_DIR_ADMIN "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-admin")
28 set(SPHINX_CACHE_DIR_HELP "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-help")
29
30 # HTML output directory
31 set(SPHINX_HTML_DIR_ADMIN "${ADMIN_MANUAL_OUT}/html")
32 set(SPHINX_HTML_DIR_HELP "${HELP_MANUAL_OUT}/html")
33
34 configure_file(
35 "${ADMIN_MANUAL_IN}/conf.py.in"
36 "${BINARY_BUILD_DIR_ADMIN}/conf.py"
37 @ONLY)
38
39 configure_file(
40 "${HELP_MANUAL_IN}/conf.py.in"
41 "${BINARY_BUILD_DIR_HELP}/conf.py"
42 @ONLY)
43
44 add_custom_target(admin_manual ALL
45 ${SPHINX_EXECUTABLE}
46 -q -b html
47 -c "${BINARY_BUILD_DIR_ADMIN}"
48 -d "${SPHINX_CACHE_DIR_ADMIN}"
49 "${ADMIN_MANUAL_IN}"
50 "${SPHINX_HTML_DIR_ADMIN}"
51 COMMENT "Building HTML Admin documentation with Sphinx")
52
53 add_custom_target(help_manual ALL
54 ${SPHINX_EXECUTABLE}
55 -q -b html
56 -c "${BINARY_BUILD_DIR_HELP}"
57 -d "${SPHINX_CACHE_DIR_HELP}"
58 "${HELP_MANUAL_IN}"
59 "${SPHINX_HTML_DIR_HELP}"
60 COMMENT "Building HTML Help with Sphinx")

http://wald.intevation.org/projects/trustbridge/