summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 2777da68..f0ead658 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -37,6 +37,7 @@ set(info_files ledger3.texi ledger-mode.texi)
find_program(MAKEINFO makeinfo)
find_program(TEXI2PDF texi2pdf)
find_program(MAN2HTML man2html)
+find_program(GROFF groff)
########################################################################
@@ -72,15 +73,21 @@ if(BUILD_WEB_DOCS)
if(NOT BASH)
message(FATAL_ERROR "Could not find bash. Unable to build documentation.")
endif()
- if(NOT MAN2HTML)
- message(FATAL_ERROR "Could not find man2html. HTML version of man page cannot be built.")
+ if(MAN2HTML)
+ add_custom_command(OUTPUT ledger.1.html
+ COMMAND ${BASH} -c "man2html ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 | tail -n+3 > ledger.1.html"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1
+ VERBATIM)
+ list(APPEND ledger_doc_files ledger.1.html)
+ elseif(GROFF)
+ add_custom_command(OUTPUT ledger.1.html
+ COMMAND ${BASH} -c "groff -mandoc -Thtml ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 > ledger.1.html"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1
+ VERBATIM)
+ list(APPEND ledger_doc_files ledger.1.html)
+ else()
+ message(FATAL_ERROR "Could not find man2html or groff. HTML version of man page cannot be built.")
endif()
-
- add_custom_command(OUTPUT ledger.1.html
- COMMAND ${BASH} -c "man2html ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 | tail -n+3 > ledger.1.html"
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1
- VERBATIM)
- list(APPEND ledger_doc_files ledger.1.html)
endif(BUILD_WEB_DOCS)
########################################################################