From e43de640e9158ef396c9dc71a13bdcbfef740e7d Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 17 Feb 2014 03:07:27 +0100 Subject: Build the man page as part of the build process, if ronn is found --- CMakeLists.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') 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 -- cgit v1.2.3