From 863afc6f51c565733611f26cb3877372f1b0cb92 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Wed, 13 Sep 2017 09:22:23 +0200 Subject: Add cmake rule to generate and install the rst manual page. --- docs/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index f16fbf6..041fc60 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -33,3 +33,25 @@ if(ENABLE_DOXYGEN) add_subdirectory(doxygen) endif(ENABLE_DOXYGEN) + +######################################################################## +# Convert manual pages from rst to roff and install them +######################################################################## +find_program(RST2MAN_EXECUTABLE NAMES rst2man rst2man.py rst2man2 rst2man2.py) +if(NOT RST2MAN_EXECUTABLE) + message(FATAL "rst2man from python-docutils is required to build man pages") +endif() + +function(BUILD_MAN_PAGE _sources _src _dst) + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_dst}" + COMMAND ${RST2MAN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_src} ${CMAKE_CURRENT_BINARY_DIR}/${_dst} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_src}) + + list(APPEND ${_sources} "${CMAKE_CURRENT_BINARY_DIR}/${_dst}") + set(${_sources} ${${_sources}} PARENT_SCOPE) + + add_custom_target(man_${_src} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_dst}) +endfunction() + +build_man_page(MAN1_OUTPUT grgsm_livemon.rst grgsm_livemon.1) +install(FILES ${MAN1_OUTPUT} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1) -- cgit v1.2.3 From cf5718cdac26054f34599428f4b1b6da45d6866f Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Wed, 20 Sep 2017 21:52:31 +0200 Subject: Install package to have rst2man available when testing. --- tests/dockerfiles/Debian_Jessie.docker | 1 + tests/dockerfiles/Debian_testing.docker | 1 + tests/dockerfiles/Ubuntu_15_04.docker | 1 + tests/dockerfiles/Ubuntu_16_04.docker | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/dockerfiles/Debian_Jessie.docker b/tests/dockerfiles/Debian_Jessie.docker index a359648..1252314 100644 --- a/tests/dockerfiles/Debian_Jessie.docker +++ b/tests/dockerfiles/Debian_Jessie.docker @@ -11,6 +11,7 @@ RUN apt-get install -y \ autoconf \ libtool \ build-essential \ + python-docutils \ libboost-all-dev \ libcppunit-dev swig \ doxygen \ diff --git a/tests/dockerfiles/Debian_testing.docker b/tests/dockerfiles/Debian_testing.docker index 4b3bced..26d67d6 100644 --- a/tests/dockerfiles/Debian_testing.docker +++ b/tests/dockerfiles/Debian_testing.docker @@ -6,6 +6,7 @@ RUN apt-get update && apt-get install -y \ autoconf \ libtool \ build-essential \ + python-docutils \ libcppunit-dev \ swig \ doxygen \ diff --git a/tests/dockerfiles/Ubuntu_15_04.docker b/tests/dockerfiles/Ubuntu_15_04.docker index 58ef22c..973b624 100644 --- a/tests/dockerfiles/Ubuntu_15_04.docker +++ b/tests/dockerfiles/Ubuntu_15_04.docker @@ -28,6 +28,7 @@ RUN apt-get update && apt-get install -y \ liblog4cpp5 \ liblog4cpp5-dev \ build-essential \ + python-docutils \ libtool \ shtool \ pkg-config \ diff --git a/tests/dockerfiles/Ubuntu_16_04.docker b/tests/dockerfiles/Ubuntu_16_04.docker index ac3e549..e0ccbea 100644 --- a/tests/dockerfiles/Ubuntu_16_04.docker +++ b/tests/dockerfiles/Ubuntu_16_04.docker @@ -6,6 +6,7 @@ RUN apt-get update && apt-get install -y \ autoconf \ libtool \ build-essential \ + python-docutils \ libcppunit-dev \ swig \ doxygen \ -- cgit v1.2.3