summaryrefslogtreecommitdiff
path: root/docs/CMakeLists.txt
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-01-13 17:48:51 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-01-13 17:48:51 +0100
commitae85db054f042875488b6b9bd02b15c7e20b00f7 (patch)
tree31ff8a7e586039c78b000b38a21cad82fc86d9ec /docs/CMakeLists.txt
parentd24225e259360e4819dc9d5643ac3c0e5df1c473 (diff)
Move from Doxygen to gtk-doc
Diffstat (limited to 'docs/CMakeLists.txt')
-rw-r--r--docs/CMakeLists.txt53
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 0000000..539317a
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,53 @@
+cmake_minimum_required(VERSION 2.8)
+
+
+pkg_check_modules(GTK_DOC gtk-doc)
+find_program(SPHINX sphinx-build PATHS /usr/local/bin /usr/bin)
+mark_as_advanced(SPHINX)
+
+# --- Create Doxygen source documentation by typing `make doc`
+if(GTK_DOC_FOUND)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/upd-ref.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/upd-ref.sh)
+
+ add_custom_target(reference
+ sh ${CMAKE_CURRENT_BINARY_DIR}/upd-ref.sh
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${ufocore_SRCS})
+endif(GTK_DOC_FOUND)
+
+if(SPHINX)
+ set(SPHINX_RESOURCES
+ source/contents.rst
+ source/api.rst
+ source/bugs.rst
+ source/build.rst
+ source/copyright.rst
+ source/faq.rst
+ source/filters.rst
+ source/glossary.rst
+ source/install.rst
+ source/install-linux.rst
+ source/install-mac.rst
+ source/json.rst
+ source/using/index.rst
+ source/whatsnew/0.1.rst
+ source/_static/ufo-logo.png
+ source/_templates/indexcontent.html
+ source/_templates/indexsidebar.html
+ )
+
+ foreach(file ${SPHINX_RESOURCES})
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${file}
+ ${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY)
+ endforeach()
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/source/conf.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/source/conf.py)
+
+ add_custom_target(manual
+ ${SPHINX} -b html ${CMAKE_CURRENT_BINARY_DIR}/source docs
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating user documentation with Sphinx" VERBATIM
+ )
+endif()