From 9f1d7015cf326cf72febefc798f8f95eeaf76ff0 Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Tue, 9 Sep 2014 20:51:50 +0200 Subject: install man page even if BUILD_DOCS isn't set The man page is useful and does not need additional software to be installed. --- doc/CMakeLists.txt | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9bf1bffe..3b96392a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -27,22 +27,18 @@ endif() ######################################################################## -if (NOT BUILD_DOCS) - add_custom_target(doc DEPENDS doc.doxygen) - return() +if (BUILD_DOCS) + find_program(MAKEINFO makeinfo) + find_program(TEXI2PDF texi2pdf) + find_program(TEX tex) + find_program(MAN2HTML man2html) + find_program(GROFF groff) + set(ledger_info_files ledger3.texi ledger-mode.texi) endif() -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) - ######################################################################## -foreach(file ${info_files}) +foreach(file ${ledger_info_files}) get_filename_component(file_base ${file} NAME_WE) if (NOT MAKEINFO) @@ -117,7 +113,7 @@ if (CMAKE_INSTALL_MANDIR) DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) endif(CMAKE_INSTALL_MANDIR) -foreach(file ${info_files}) +foreach(file ${ledger_info_files}) get_filename_component(file_base ${file} NAME_WE) if (CMAKE_SOURCE_DIR STREQUAL BUILD_DIR) -- cgit v1.2.3 From 2860b68bc2568dc67f9228377842c2eac14bf31a Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Tue, 9 Sep 2014 21:15:11 +0200 Subject: clean up installation of doc files --- acprep | 3 --- doc/CMakeLists.txt | 26 ++++++++++---------------- 2 files changed, 10 insertions(+), 19 deletions(-) (limited to 'doc') diff --git a/acprep b/acprep index 7984f767..a6cadc7f 100755 --- a/acprep +++ b/acprep @@ -815,9 +815,6 @@ 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 3b96392a..6b8fa01e 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -113,22 +113,16 @@ if (CMAKE_INSTALL_MANDIR) DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) endif(CMAKE_INSTALL_MANDIR) -foreach(file ${ledger_info_files}) - get_filename_component(file_base ${file} NAME_WE) - - 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() +foreach(file ${ledger_doc_files}) + get_filename_component(file_ext ${file} EXT) - install(FILES ${doc_dir}/${file_base}.info - DESTINATION ${CMAKE_INSTALL_INFODIR} COMPONENT doc) - 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 + if(file_ext STREQUAL ".info") + if(CMAKE_INSTALL_INFODIR) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} + DESTINATION ${CMAKE_INSTALL_INFODIR} COMPONENT doc) + endif() + elseif(CMAKE_INSTALL_DOCDIR) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc) - endif(BUILD_WEB_DOCS) + endif() endforeach() -- cgit v1.2.3 From d9d4876755efd97fdd7c7ce7552e7c6ee339a94c Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Tue, 9 Sep 2014 22:09:09 +0200 Subject: reduce number of warning messages when building docs Warnings were emitted for every info file (twice) instead of once. --- doc/CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'doc') 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() -- cgit v1.2.3