piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 1 | # Copyright 2011 Free Software Foundation, Inc. |
| 2 | # |
| 3 | # This file is part of GNU Radio |
| 4 | # |
| 5 | # GNU Radio is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 3, or (at your option) |
| 8 | # any later version. |
| 9 | # |
| 10 | # GNU Radio is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with GNU Radio; see the file COPYING. If not, write to |
| 17 | # the Free Software Foundation, Inc., 51 Franklin Street, |
| 18 | # Boston, MA 02110-1301, USA. |
| 19 | |
| 20 | ######################################################################## |
| 21 | # Setup dependencies |
| 22 | ######################################################################## |
| 23 | find_package(Doxygen) |
| 24 | |
| 25 | ######################################################################## |
| 26 | # Begin conditional configuration |
| 27 | ######################################################################## |
| 28 | if(ENABLE_DOXYGEN) |
| 29 | |
| 30 | ######################################################################## |
| 31 | # Add subdirectories |
| 32 | ######################################################################## |
| 33 | add_subdirectory(doxygen) |
| 34 | |
| 35 | endif(ENABLE_DOXYGEN) |
Petter Reinholdtsen | 863afc6 | 2017-09-13 09:22:23 +0200 | [diff] [blame] | 36 | |
| 37 | ######################################################################## |
| 38 | # Convert manual pages from rst to roff and install them |
| 39 | ######################################################################## |
| 40 | find_program(RST2MAN_EXECUTABLE NAMES rst2man rst2man.py rst2man2 rst2man2.py) |
Petter Reinholdtsen | 863afc6 | 2017-09-13 09:22:23 +0200 | [diff] [blame] | 41 | |
| 42 | function(BUILD_MAN_PAGE _sources _src _dst) |
| 43 | add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_dst}" |
| 44 | COMMAND ${RST2MAN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_src} ${CMAKE_CURRENT_BINARY_DIR}/${_dst} |
| 45 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_src}) |
| 46 | |
| 47 | list(APPEND ${_sources} "${CMAKE_CURRENT_BINARY_DIR}/${_dst}") |
| 48 | set(${_sources} ${${_sources}} PARENT_SCOPE) |
| 49 | |
| 50 | add_custom_target(man_${_src} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_dst}) |
| 51 | endfunction() |
| 52 | |
Piotr Krysik | fa2bb86 | 2017-09-23 21:38:08 +0200 | [diff] [blame] | 53 | if(NOT RST2MAN_EXECUTABLE) |
| 54 | message(WARNING "rst2man from python-docutils is required to build man pages") |
| 55 | else() |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 56 | #build_man_page(MAN1_OUTPUT grgsm_livemon.rst grgsm_livemon.1) |
Piotr Krysik | fa2bb86 | 2017-09-23 21:38:08 +0200 | [diff] [blame] | 57 | install(FILES ${MAN1_OUTPUT} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1) |
| 58 | endif() |
| 59 | |
| 60 | |