From 8589356224762c7a3f7db647ffef141ff4346e63 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 6 Jul 2006 01:40:44 +0000 Subject: [PATCH] Write cmake scripts for building the html manual this is also the start of some docutils CMAKE support --- CMakeLists.txt | 1 + doc/CMakeLists.txt | 1 + doc/manual/CMakeLists.txt | 4 ++++ makelib/FindDocutils.cmake | 30 ++++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 doc/CMakeLists.txt create mode 100644 doc/manual/CMakeLists.txt create mode 100644 makelib/FindDocutils.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b92af8d..e5ca030 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ ENDIF(NOT CMAKE_BUILD_TYPE) # all of our source files al relative to the root of our project INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) +ADD_SUBDIRECTORY( doc ) ADD_SUBDIRECTORY( alg ) ADD_SUBDIRECTORY( qui ) ADD_SUBDIRECTORY( py ) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..c22da00 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY( manual ) diff --git a/doc/manual/CMakeLists.txt b/doc/manual/CMakeLists.txt new file mode 100644 index 0000000..a9c6fc1 --- /dev/null +++ b/doc/manual/CMakeLists.txt @@ -0,0 +1,4 @@ +FIND_PACKAGE(Docutils) + +RST2HTML(mussagl_manual.rst) + diff --git a/makelib/FindDocutils.cmake b/makelib/FindDocutils.cmake new file mode 100644 index 0000000..1eed862 --- /dev/null +++ b/makelib/FindDocutils.cmake @@ -0,0 +1,30 @@ +# Macros to make using docutils to build documentation easier + +FIND_PROGRAM(RST2HTML_PY + NAMES rst2html.py rst2html + DOC "location of the python docutils reStructured text html " + "converter" + ) + +IF(RST2HTML_PY) + MACRO(RST2HTML) + FOREACH(it ${ARGN}) + GET_FILENAME_COMPONENT(basename ${it} NAME_WE) + + SET(infile ${CMAKE_CURRENT_SOURCE_DIR}/${it} ) + SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${basename}.html) + + ADD_CUSTOM_COMMAND( + OUTPUT ${outfile} + COMMAND ${RST2HTML_PY} + ARGS ${infile} ${outfile} + DEPENDS ${infile} + ) + + ADD_CUSTOM_TARGET(RstHTMLDocuments_${outfile} ALL DEPENDS ${outfile}) + + ENDFOREACH(it) + ENDMACRO(RST2HTML) +ENDIF(RST2HTML_PY) + +# There really should be some code for building the pdf as well -- 2.30.2