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
  "/<<PKGBUILDDIR>>/build/doc/html": No such file or
  directory.
 Call Stack (most recent call first):
  cmake_install.cmake:59 (include)
This commit is contained in:
Samuel Henrique 2022-03-01 22:08:32 +00:00 committed by Patrick Ziegler
parent 24e079afef
commit 40cbe7ed97
2 changed files with 10 additions and 4 deletions

View File

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Build ### Build
- Fixed compiler warning in Clang 13 ([`#2613`](https://github.com/polybar/polybar/pull/2613)) - 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 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 ## [3.6.0] - 2022-03-01
### Breaking ### Breaking

View File

@ -49,10 +49,12 @@ endforeach()
# Dummy target that depends on all documentation targets # Dummy target that depends on all documentation targets
add_custom_target(doc ALL DEPENDS ${doc_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} DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT doc COMPONENT doc
PATTERN ".buildinfo" EXCLUDE) PATTERN ".buildinfo" EXCLUDE)
endif()
install(FILES ${CMAKE_SOURCE_DIR}/CHANGELOG.md install(FILES ${CMAKE_SOURCE_DIR}/CHANGELOG.md
DESTINATION ${CMAKE_INSTALL_DOCDIR} DESTINATION ${CMAKE_INSTALL_DOCDIR}
@ -62,14 +64,17 @@ install(FILES ${CMAKE_CURRENT_LIST_DIR}/config.ini
DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples
COMPONENT doc) 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 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
COMPONENT doc) 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 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
COMPONENT doc) 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 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5
COMPONENT doc) COMPONENT doc)
endif()