From e167cbb64713ec1feeefaa98594361069c973faa Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 27 Apr 2014 11:06:02 +0200 Subject: doc: try to use groff if man2html is not found to generate a html version of the manpage, throw a fatal error otherwise. --- doc/CMakeLists.txt | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'doc/CMakeLists.txt') 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) ######################################################################## -- cgit v1.2.3 From c933e7859922c04cafcd145090c7546e8d8d2d60 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 27 Apr 2014 11:08:01 +0200 Subject: doc: add BUILD_A4_PDF cmake variable to create a DIN A4 paper version of the ledger pdf. --- doc/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f0ead658..15f1318c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -58,8 +58,11 @@ foreach(file ${info_files}) if(NOT TEXI2PDF) message(WARNING "Could not find texi2pdf. PDF version of documentation will not be built.") else() + if(BUILD_A4_PDF) + set(papersize --texinfo=@afourpaper) + endif() add_custom_command(OUTPUT ${file_base}.pdf - COMMAND texi2pdf -b -q -o ${file_base}.pdf ${CMAKE_CURRENT_SOURCE_DIR}/${file} + COMMAND texi2pdf ${papersize} -b -q -o ${file_base}.pdf ${CMAKE_CURRENT_SOURCE_DIR}/${file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} VERBATIM) list(APPEND ledger_doc_files ${file_base}.pdf) -- cgit v1.2.3 From 87bcfee8fd3054fa22deb1cc2e8eb32943c509e3 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 4 May 2014 01:14:39 +0200 Subject: Build info version of documentation --- doc/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 15f1318c..cd68f828 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -43,6 +43,17 @@ find_program(GROFF groff) foreach(file ${info_files}) get_filename_component(file_base ${file} NAME_WE) + + if(NOT MAKEINFO) + message(WARNING "Could not find makeinfo. Info version of documentation cannot be built.") + else() + add_custom_command(OUTPUT ${file_base}.info + COMMAND makeinfo --force --no-split -o ${file_base}.info ${CMAKE_CURRENT_SOURCE_DIR}/${file} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + VERBATIM) + list(APPEND ledger_doc_files ${file_base}.info) + endif() + if(BUILD_WEB_DOCS) if(NOT MAKEINFO) message(FATAL_ERROR "Could not find makeinfo. HTML version of documentation cannot be built.") -- cgit v1.2.3 From 851dea238ac230d44c5df00dd738cee9aa5780d3 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 4 May 2014 01:16:19 +0200 Subject: Check for required TeX when building pdf documentation --- doc/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index cd68f828..e359c5e4 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -36,6 +36,7 @@ set(info_files ledger3.texi ledger-mode.texi) find_program(MAKEINFO makeinfo) find_program(TEXI2PDF texi2pdf) +find_program(TEX tex) find_program(MAN2HTML man2html) find_program(GROFF groff) @@ -56,9 +57,8 @@ foreach(file ${info_files}) if(BUILD_WEB_DOCS) if(NOT MAKEINFO) - message(FATAL_ERROR "Could not find makeinfo. HTML version of documentation cannot be built.") + message(WARNING "Could not find makeinfo. HTML version of documentation cannot be built.") endif() - add_custom_command(OUTPUT ${file_base}.html COMMAND makeinfo --force --html --no-split -o ${file_base}.html ${CMAKE_CURRENT_SOURCE_DIR}/${file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} @@ -66,8 +66,8 @@ foreach(file ${info_files}) list(APPEND ledger_doc_files ${file_base}.html) endif(BUILD_WEB_DOCS) - if(NOT TEXI2PDF) - message(WARNING "Could not find texi2pdf. PDF version of documentation will not be built.") + if(NOT TEXI2PDF OR NOT TEX) + message(WARNING "Could not find texi2pdf or tex. PDF version of documentation will not be built.") else() if(BUILD_A4_PDF) set(papersize --texinfo=@afourpaper) -- cgit v1.2.3 From dcb285ac556aa54aa01c60b3c1c9fa40199d8f06 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 4 May 2014 01:17:02 +0200 Subject: Improve installation of documentation files - Install info version of ledger documentation instead of the original texinfo sources - Install html version of ledger documentation when BUILD_WEB_DOCS is ON - Enable installation of documentation files from --output directory --- acprep | 3 +++ doc/CMakeLists.txt | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'doc/CMakeLists.txt') diff --git a/acprep b/acprep index 1faeb4f6..f9fb74d7 100755 --- a/acprep +++ b/acprep @@ -875,6 +875,9 @@ class PrepareBuild(CommandLineApp): if self.options.boost_include: conf_args.append('-DBOOST_INCLUDEDIR=%s' % self.options.boost_include) + if self.options.build_dir: + conf_args.append('-DBUILD_DIR=%s' % + self.options.build_dir) if self.prefix_directory(): conf_args.append('-DCMAKE_INSTALL_PREFIX=%s' % self.prefix_directory()) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index e359c5e4..8a9ba2fd 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -120,8 +120,19 @@ endif(CMAKE_INSTALL_MANDIR) foreach(file ${info_files}) get_filename_component(file_base ${file} NAME_WE) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file} + if (CMAKE_SOURCE_DIR STREQUAL BUILD_DIR) + set(doc_dir CMAKE_CURRENT_SOURCE_DIR) + else() + get_filename_component(dir_base ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE) + set(doc_dir "${CMAKE_SOURCE_DIR}/${BUILD_DIR}/${dir_base}") + endif() + + install(FILES ${doc_dir}/${file_base}.info DESTINATION ${CMAKE_INSTALL_INFODIR} COMPONENT doc) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file_base}.pdf + install(FILES ${doc_dir}/${file_base}.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc OPTIONAL) + if (BUILD_WEB_DOCS) + install(FILES ${doc_dir}/${file_base}.html + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc) + endif(BUILD_WEB_DOCS) endforeach() -- cgit v1.2.3