diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-07-04 16:00:13 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-07-04 16:02:54 -0400 |
commit | 23a1e944027265c70654d7395362641b59428062 (patch) | |
tree | 65ddb77c3b3879cb971fa5bc550316ef7041b7d3 /CMake/Manpage.cmake | |
parent | 496cec3cb7ba9e2648d023b8bda09a79d1d958ed (diff) |
Make asciidoc (and man pages) optional
And remove it from the build
Diffstat (limited to 'CMake/Manpage.cmake')
-rw-r--r-- | CMake/Manpage.cmake | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/CMake/Manpage.cmake b/CMake/Manpage.cmake index d9780bc4..cc04d710 100644 --- a/CMake/Manpage.cmake +++ b/CMake/Manpage.cmake @@ -1,31 +1,33 @@ -find_package(A2X REQUIRED) +find_package(A2X) -add_custom_target(man ALL) +if (A2X_FOUND) + add_custom_target(man ALL) -function(add_manpage name section) - add_custom_command( - OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section} - COMMAND ${A2X_COMMAND} - --no-xmllint - --doctype manpage - --format manpage - -D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt - COMMENT Generating manpage for ${name}.${section} - ) + function(add_manpage name section) + add_custom_command( + OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section} + COMMAND ${A2X_COMMAND} + --no-xmllint + --doctype manpage + --format manpage + -D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt + COMMENT Generating manpage for ${name}.${section} + ) - add_custom_target(man-${name}.${section} - DEPENDS - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section} - ) - add_dependencies(man - man-${name}.${section} - ) + add_custom_target(man-${name}.${section} + DEPENDS + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section} + ) + add_dependencies(man + man-${name}.${section} + ) - install( - FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section} - DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/man/man${section} - COMPONENT documentation - ) -endfunction() + install( + FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section} + DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/man/man${section} + COMPONENT documentation + ) + endfunction() +endif() |