summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-02-17 03:07:27 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-02-17 03:07:27 +0100
commite43de640e9158ef396c9dc71a13bdcbfef740e7d (patch)
tree492bda0187b083880e5693bd542c0b9f6f5b9cfe /CMakeLists.txt
parentc5b4be0e17a21449d226ebcc3a9313a020c0c8b4 (diff)
downloadbiboumi-e43de640e9158ef396c9dc71a13bdcbfef740e7d.tar.gz
biboumi-e43de640e9158ef396c9dc71a13bdcbfef740e7d.tar.bz2
biboumi-e43de640e9158ef396c9dc71a13bdcbfef740e7d.tar.xz
biboumi-e43de640e9158ef396c9dc71a13bdcbfef740e7d.zip
Build the man page as part of the build process, if ronn is found
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 660f238..edbc87e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,18 @@ if((NOT ${POLLER} MATCHES "POLL") AND
message(FATAL_ERROR "POLLER must be either POLL or EPOLL")
endif()
+#
+## Documentation
+#
+find_program(RONN_EXECUTABLE NAMES ronn
+ DOC "The ronn software, to build the man page from the markdown documentation")
+if(RONN_EXECUTABLE)
+ set(WITH_DOC true)
+ add_custom_target(doc
+ ${RONN_SOFTWARE} --roff ${CMAKE_CURRENT_BINARY_DIR}/doc/${PROJECT_NAME}.1.md
+ COMMENT "Generate the man page" VERBATIM)
+endif()
+
#
## utils
@@ -111,6 +123,9 @@ target_link_libraries(${PROJECT_NAME}
bridge
utils
config)
+if(WITH_DOC)
+ add_dependencies(${PROJECT_NAME} doc)
+endif()
#
## Tests
@@ -132,4 +147,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin)
-install(FILES doc/${PROJECT_NAME}.1 DESTINATION man/man1)
+if(WITH_DOC)
+ install(FILES doc/${PROJECT_NAME}.1 DESTINATION man/man1)
+endif() \ No newline at end of file