summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-11-06 18:24:00 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-11-06 18:24:00 +0100
commit3ed7b5043fb5ae1862775d37d617af87ad3f9102 (patch)
tree6f157b82d7899f37538edeaa1738beff6dee038d /docs
parente3e6543cc7881fe2476023d5e2b1a7bb11eda9f3 (diff)
downloadufo-filters-3ed7b5043fb5ae1862775d37d617af87ad3f9102.tar.gz
ufo-filters-3ed7b5043fb5ae1862775d37d617af87ad3f9102.tar.bz2
ufo-filters-3ed7b5043fb5ae1862775d37d617af87ad3f9102.tar.xz
ufo-filters-3ed7b5043fb5ae1862775d37d617af87ad3f9102.zip
Add option to build Sphinx manual
Diffstat (limited to 'docs')
-rw-r--r--docs/CMakeLists.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 0000000..1ccfca0
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 2.6)
+
+find_program(SPHINX sphinx-build PATHS /usr/local/bin /usr/bin)
+mark_as_advanced(SPHINX)
+
+# --- End-user manual ---------------------------------------------------------
+if(SPHINX)
+ option(WITH_MANUAL "Build user manual" ON)
+
+ if (WITH_MANUAL)
+ set(input_dir ${CMAKE_CURRENT_SOURCE_DIR})
+ set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/manual/html)
+
+ file(GLOB_RECURSE sphinx_source ${input_dir}/*.rst)
+
+ foreach(file ${sphinx_static})
+ configure_file(${input_dir}/${file} ${output_dir}/${file} COPYONLY)
+ endforeach()
+
+ add_custom_command(OUTPUT ${output_dir}/index.html
+ COMMAND ${SPHINX} -b html ${input_dir} ${output_dir}
+ DEPENDS ${sphinx_source}
+ COMMENT "Build Sphinx HTML")
+
+ add_custom_target(manual ALL DEPENDS ${output_dir}/index.html)
+
+ add_dependencies(manual ufo)
+ endif()
+endif()
+