Generate html documentation as part of the normal build.

develop
Petr Mrázek 2012-09-29 03:30:38 +02:00
parent 09ddccea6c
commit 38f2ae399a
3 changed files with 25 additions and 6 deletions

@ -147,11 +147,30 @@ add_subdirectory(depends)
find_package(Docutils) find_package(Docutils)
set (RST_FILES
README
COMPILE
LUA_API
)
set (RST_PROCESSED_FILES "")
IF(RST2HTML_EXECUTABLE)
foreach(F ${RST_FILES})
add_custom_command(
OUTPUT "${dfhack_BINARY_DIR}/${F}.html"
COMMAND ${RST2HTML_EXECUTABLE} "${dfhack_SOURCE_DIR}/${F}.rst" > "${dfhack_BINARY_DIR}/${F}.html"
COMMENT "Translating ${F} to html"
DEPENDS "${dfhack_SOURCE_DIR}/${F}.rst")
list (APPEND RST_PROCESSED_FILES "${dfhack_BINARY_DIR}/${F}.html")
endforeach()
add_custom_target(HTML_DOCS ALL DEPENDS ${RST_PROCESSED_FILES})
ENDIF()
# build the lib itself # build the lib itself
IF(BUILD_LIBRARY) IF(BUILD_LIBRARY)
add_subdirectory (library) add_subdirectory (library)
## install the default documentation files ## install the default documentation files
install(FILES LICENSE Readme.html Compile.html Lua\ API.html DESTINATION ${DFHACK_USERDOC_DESTINATION}) install(FILES LICENSE ${RST_PROCESSED_FILES} DESTINATION ${DFHACK_USERDOC_DESTINATION})
endif() endif()
#build the plugins #build the plugins

@ -1,5 +0,0 @@
#!/bin/bash
rst2html README.rst > Readme.html
rst2html COMPILE.rst > Compile.html
rst2html DEVEL.rst > Devel.html
rst2html LUA_API.rst > Lua\ API.html

@ -0,0 +1,5 @@
#!/bin/bash
# this script is used for easy testing of the rst documentation files.
rst2html README.rst > README.html
rst2html COMPILE.rst > COMPILE.html
rst2html LUA_API.rst > LUA_API.html