diff options
author | Piotr Krysik <ptrkrysik@users.noreply.github.com> | 2017-09-23 18:19:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-23 18:19:02 +0200 |
commit | 20510f4fe613bcccc0488e58540caa46054dba64 (patch) | |
tree | 261ba2335c0bdf51919cbec44740783358251647 | |
parent | d890cd3b368abba73003482327ee5740d5dfcf69 (diff) | |
parent | cf5718cdac26054f34599428f4b1b6da45d6866f (diff) |
Merge pull request #333 from petterreinholdtsen/install-man
Add cmake rule to generate and install the rst manual page.
-rw-r--r-- | docs/CMakeLists.txt | 22 | ||||
-rw-r--r-- | tests/dockerfiles/Debian_Jessie.docker | 1 | ||||
-rw-r--r-- | tests/dockerfiles/Debian_testing.docker | 1 | ||||
-rw-r--r-- | tests/dockerfiles/Ubuntu_15_04.docker | 1 | ||||
-rw-r--r-- | tests/dockerfiles/Ubuntu_16_04.docker | 1 |
5 files changed, 26 insertions, 0 deletions
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) 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 \ |