diff options
| author | Petr Mrázek | 2012-09-29 03:30:38 +0200 |
|---|---|---|
| committer | Petr Mrázek | 2012-09-29 03:30:38 +0200 |
| commit | 38f2ae399a443ffa6f215c5d3c8ff2329de333ff (patch) | |
| tree | 7802a233bc2af80ac918a1d823644b4346052422 /CMakeLists.txt | |
| parent | 09ddccea6cf539fb00098b2e6a34245c35ea815c (diff) | |
| download | dfhack-38f2ae399a443ffa6f215c5d3c8ff2329de333ff.tar.gz dfhack-38f2ae399a443ffa6f215c5d3c8ff2329de333ff.tar.bz2 dfhack-38f2ae399a443ffa6f215c5d3c8ff2329de333ff.tar.xz | |
Generate html documentation as part of the normal build.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bd4ad97..ee3f1d2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,11 +147,30 @@ add_subdirectory(depends) 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 IF(BUILD_LIBRARY) add_subdirectory (library) ## 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() #build the plugins |
