diff options
author | Johann Klähn <kljohann@gmail.com> | 2014-09-09 22:09:09 +0200 |
---|---|---|
committer | Johann Klähn <kljohann@gmail.com> | 2014-09-10 00:40:36 +0200 |
commit | d9d4876755efd97fdd7c7ce7552e7c6ee339a94c (patch) | |
tree | c194d925cbb3286d8e63aebd71cd4e903abb33bc /doc/CMakeLists.txt | |
parent | 2860b68bc2568dc67f9228377842c2eac14bf31a (diff) | |
download | fork-ledger-d9d4876755efd97fdd7c7ce7552e7c6ee339a94c.tar.gz fork-ledger-d9d4876755efd97fdd7c7ce7552e7c6ee339a94c.tar.bz2 fork-ledger-d9d4876755efd97fdd7c7ce7552e7c6ee339a94c.zip |
reduce number of warning messages when building docs
Warnings were emitted for every info file (twice) instead of once.
Diffstat (limited to 'doc/CMakeLists.txt')
-rw-r--r-- | doc/CMakeLists.txt | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 6b8fa01e..96c6d518 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -34,6 +34,14 @@ if (BUILD_DOCS) find_program(MAN2HTML man2html) find_program(GROFF groff) set(ledger_info_files ledger3.texi ledger-mode.texi) + + if (NOT MAKEINFO) + message(WARNING "Could not find makeinfo. Info version of documentation cannot be built.") + endif() + + if (NOT TEXI2PDF OR NOT TEX) + message(WARNING "Could not find texi2pdf or tex. PDF version of documentation will not be built.") + endif() endif() ######################################################################## @@ -41,9 +49,7 @@ endif() foreach(file ${ledger_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() + if (MAKEINFO) 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} @@ -51,20 +57,15 @@ foreach(file ${ledger_info_files}) list(APPEND ledger_doc_files ${file_base}.info) endif() - if (BUILD_WEB_DOCS) - if (NOT MAKEINFO) - message(WARNING "Could not find makeinfo. HTML version of documentation cannot be built.") - endif() + if (BUILD_WEB_DOCS AND MAKEINFO) 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} VERBATIM) list(APPEND ledger_doc_files ${file_base}.html) - endif(BUILD_WEB_DOCS) + endif() - if (NOT TEXI2PDF OR NOT TEX) - message(WARNING "Could not find texi2pdf or tex. PDF version of documentation will not be built.") - else() + if (TEXI2PDF AND TEX) if (BUILD_A4_PDF) set(papersize --texinfo=@afourpaper) endif() |