From 40cbe7ed97b541b60547a6d80b04c9121837e01d Mon Sep 17 00:00:00 2001 From: Samuel Henrique Date: Tue, 1 Mar 2022 22:08:32 +0000 Subject: [PATCH] Skip manpage and html doc installation if they weren't generated Otherwise we get errors like this: CMake Error at doc/cmake_install.cmake:46 (file): file INSTALL cannot find "/<>/build/doc/html": No such file or directory. Call Stack (most recent call first): cmake_install.cmake:59 (include) --- CHANGELOG.md | 1 + doc/CMakeLists.txt | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c51311fd..52a614ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Build - Fixed compiler warning in Clang 13 ([`#2613`](https://github.com/polybar/polybar/pull/2613)) - Fixed compiler error in GCC 12 ([`#2616`](https://github.com/polybar/polybar/pull/2616), [`#2614`](https://github.com/polybar/polybar/issues/2614)) +- Fixed installation of docs when some are not generated (man, html...) ([`#2612`](https://github.com/polybar/polybar/pull/2612) ## [3.6.0] - 2022-03-01 ### Breaking diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 27d86b6d..abecc6bf 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -49,10 +49,12 @@ endforeach() # Dummy target that depends on all documentation targets add_custom_target(doc ALL DEPENDS ${doc_targets}) -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ +if (BUILD_DOC_HTML) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc PATTERN ".buildinfo" EXCLUDE) +endif() install(FILES ${CMAKE_SOURCE_DIR}/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DOCDIR} @@ -62,14 +64,17 @@ install(FILES ${CMAKE_CURRENT_LIST_DIR}/config.ini DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples COMPONENT doc) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/polybar.1 +if (BUILD_DOC_MAN) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/polybar.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/polybar-msg.1 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/polybar-msg.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/polybar.5 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/polybar.5 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5 COMPONENT doc) +endif() +