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 --- doc/CMakeLists.txt | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'doc/CMakeLists.txt') 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