aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-20 18:52:13 -0400
committerDrew DeVault <sir@cmpwn.com>2017-06-20 18:52:13 -0400
commitd1493b23918f5558a0f6a24c9a7a2bb34207a6ed (patch)
treea0c6aeb65de40803a48f8e06d23ca79f8d2d03a1
parentc2d0090ad7b0528b308741e67cdae11d58792d13 (diff)
Actually make a2x optional
We might not even write man pages tbh
-rw-r--r--CMake/Manpage.cmake56
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()