# 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