summaryrefslogtreecommitdiff
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2014-04-27 11:06:02 +0200
committerAlexis Hildebrandt <afh@surryhill.net>2014-04-27 11:11:40 +0200
commite167cbb64713ec1feeefaa98594361069c973faa (patch)
tree4704c5ba5e21ecea067f6c894a8eb4a2e718ecf3 /doc/CMakeLists.txt
parent0e496b4f9ba9b8376283bfe202d28bb538c438cc (diff)
downloadfork-ledger-e167cbb64713ec1feeefaa98594361069c973faa.tar.gz
fork-ledger-e167cbb64713ec1feeefaa98594361069c973faa.tar.bz2
fork-ledger-e167cbb64713ec1feeefaa98594361069c973faa.zip
doc: try to use groff if man2html is not found
to generate a html version of the manpage, throw a fatal error otherwise.
Diffstat (limited to 'doc/CMakeLists.txt')
-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)
########################################################################