From 187ab35fe56bf3f17ae56fb4d7c8143e92f9fdc4 Mon Sep 17 00:00:00 2001 From: Paiusco <> Date: Mon, 26 Feb 2024 10:42:21 +0100 Subject: [PATCH] documentation is opt-out on CMake --- manpage/CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/manpage/CMakeLists.txt b/manpage/CMakeLists.txt index a7e3ac3..f70b12e 100644 --- a/manpage/CMakeLists.txt +++ b/manpage/CMakeLists.txt @@ -1,8 +1,3 @@ -find_program(SCDOC scdoc) -if(NOT SCDOC) - message(FATAL_ERROR "scdoc not found") -endif() - function(man_page section page) set(src "${CMAKE_CURRENT_SOURCE_DIR}/${page}.${section}.scd") set(bin "${CMAKE_CURRENT_BINARY_DIR}/${page}.${section}") @@ -10,5 +5,15 @@ function(man_page section page) install(FILES ${bin} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${section}/) endfunction(man_page) -man_page(1 ydotool) -man_page(8 ydotoold) +option(BUILD_DOCS "build documentation (requires scdoc)" ON) + +find_program(SCDOC scdoc) + +if(BUILD_DOCS AND NOT SCDOC) + message(FATAL_ERROR "build documentation selected, but scdoc could not be found") +endif() + +if(BUILD_DOCS) + man_page(1 ydotool) + man_page(8 ydotoold) +endif()