From 5931a9377795ecc7d48f11c4d5dbebc158f1b00e Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Tue, 9 Sep 2014 20:43:16 +0200 Subject: avoid policy warning with recent CMake versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See `cmake --help-policy CMP0026` with CMake ≥ 3.0. --- test/CMakeLists.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0f19ae6f..21d27c7d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,8 +6,6 @@ if (NOT PROCESSORS EQUAL 0) set(CTEST_BUILD_FLAGS -j${JOBS}) endif() -get_target_property(LEDGER_LOCATION ledger LOCATION) - add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_BUILD_FLAGS}) add_subdirectory(unit) @@ -23,9 +21,9 @@ macro(add_ledger_harness_tests _class) get_filename_component(TestFile_Name ${TestFile} NAME_WE) string(FIND ${TestFile_Name} "_py" TestFile_IsPythonTest) if ((TestFile_IsPythonTest EQUAL -1) OR HAVE_BOOST_PYTHON) - add_test(${_class}Test_${TestFile_Name} - ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/RegressTests.py - ${LEDGER_LOCATION} ${PROJECT_SOURCE_DIR} + add_test(NAME ${_class}Test_${TestFile_Name} + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/RegressTests.py + $ ${PROJECT_SOURCE_DIR} ${TestFile} ${TEST_PYTHON_FLAGS}) set_target_properties(check PROPERTIES DEPENDS ${_class}Test_${TestFile_Name}) @@ -44,9 +42,9 @@ add_subdirectory(regress) # file(GLOB ${_class}_TESTS ${PROJECT_SOURCE_DIR}/doc/*.texi) # foreach(TestFile ${${_class}_TESTS}) # get_filename_component(TestFile_Name ${TestFile} NAME_WE) -# add_test(${_class}Test_${TestFile_Name} -# ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/DocTests.py -# --ledger ${LEDGER_LOCATION} --file ${TestFile}) +# add_test(NAME ${_class}Test_${TestFile_Name} +# COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/DocTests.py +# --ledger $ --file ${TestFile}) # set_target_properties(check PROPERTIES DEPENDS ${_class}Test_${TestFile_Name}) # endforeach() #endif() -- cgit v1.2.3 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(-) 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(-) 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(-) 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