-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from Paiusco/build-doc-optional
Build documentation is opt-out on CMake
- Loading branch information
Showing
1 changed file
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
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}") | ||
add_custom_target(${page}.${section} ALL COMMAND ${SCDOC} < ${src} > ${bin}) | ||
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() |