| 1 |
# It's not possible to install the docbook right now (Qt-only project) |
| 2 |
#add_subdirectory(icemon) |
| 3 |
|
| 4 |
find_program(pandoc_EXECUTABLE pandoc) |
| 5 |
find_package_handle_standard_args(pandoc |
| 6 |
REQUIRED_VARS |
| 7 |
pandoc_EXECUTABLE |
| 8 |
) |
| 9 |
mark_as_advanced(pandoc_EXECUTABLE) |
| 10 |
set_package_properties(pandoc PROPERTIES |
| 11 |
TYPE REQUIRED |
| 12 |
DESCRIPTION "A universal document converter. Used for generating manpages." |
| 13 |
URL "https://pandoc.org/" |
| 14 |
) |
| 15 |
|
| 16 |
if (pandoc_FOUND) |
| 17 |
add_custom_target(manpage ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/icemon.1) |
| 18 |
add_custom_command( |
| 19 |
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icemon.1 |
| 20 |
COMMAND ${pandoc_EXECUTABLE} -s -t man ${CMAKE_CURRENT_SOURCE_DIR}/icemon.md |
| 21 |
-o ${CMAKE_CURRENT_BINARY_DIR}/icemon.1 |
| 22 |
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/icemon.md) |
| 23 |
install( |
| 24 |
FILES ${CMAKE_CURRENT_BINARY_DIR}/icemon.1 |
| 25 |
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) |
| 26 |
endif() |