diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/manuals/CMakeLists.txt	Fri Aug 22 17:06:56 2014 +0200
@@ -0,0 +1,60 @@
+# Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
+#
+# This file is Free Software under the GNU GPL (v>=2)
+# and comes with ABSOLUTELY NO WARRANTY!
+# See LICENSE.txt for details.
+
+if(NOT DEFINED SPHINX_THEME)
+    set(SPHINX_THEME better)
+endif()
+
+if(NOT DEFINED SPHINX_THEME_DIR)
+   set(SPHINX_THEME_DIR "${CMAKE_CURRENT_SOURCE_DIR}/theme")
+endif()
+
+set(ADMIN_MANUAL_IN "${CMAKE_CURRENT_SOURCE_DIR}/admin-manual")
+set(ADMIN_MANUAL_OUT "${CMAKE_CURRENT_BINARY_DIR}/admin-manual")
+set(HELP_MANUAL_IN "${CMAKE_CURRENT_SOURCE_DIR}/help-manual")
+set(HELP_MANUAL_OUT "${CMAKE_CURRENT_BINARY_DIR}/help-manual")
+
+
+# configured documentation tools and intermediate build results
+set(BINARY_BUILD_DIR_ADMIN "${CMAKE_CURRENT_BINARY_DIR}/_build-admin")
+set(BINARY_BUILD_DIR_HELP "${CMAKE_CURRENT_BINARY_DIR}/_build-help")
+
+# Sphinx cache with pickled ReST documents
+set(SPHINX_CACHE_DIR_ADMIN "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-admin")
+set(SPHINX_CACHE_DIR_HELP "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-help")
+
+# HTML output directory
+set(SPHINX_HTML_DIR_ADMIN "${ADMIN_MANUAL_OUT}/html")
+set(SPHINX_HTML_DIR_HELP "${HELP_MANUAL_OUT}/html")
+
+configure_file(
+    "${ADMIN_MANUAL_IN}/conf.py.in"
+    "${BINARY_BUILD_DIR_ADMIN}/conf.py"
+    @ONLY)
+
+configure_file(
+    "${HELP_MANUAL_IN}/conf.py.in"
+    "${BINARY_BUILD_DIR_HELP}/conf.py"
+    @ONLY)
+
+add_custom_target(admin_manual ALL
+    ${SPHINX_EXECUTABLE}
+        -q -b html
+        -c "${BINARY_BUILD_DIR_ADMIN}"
+        -d "${SPHINX_CACHE_DIR_ADMIN}"
+        "${ADMIN_MANUAL_IN}"
+        "${SPHINX_HTML_DIR_ADMIN}"
+        COMMENT "Building HTML Admin documentation with Sphinx")
+
+add_custom_target(help_manual ALL
+    ${SPHINX_EXECUTABLE}
+        -q -b html
+        -c "${BINARY_BUILD_DIR_HELP}"
+        -d "${SPHINX_CACHE_DIR_HELP}"
+        "${HELP_MANUAL_IN}"
+        "${SPHINX_HTML_DIR_HELP}"
+        COMMENT "Building HTML Help with Sphinx")

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