blob: d2f9b1cc9cd3936c43355538402e5525cf640812 [file] [log] [blame]
piotr437f5462014-02-04 17:57:25 +01001# 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########################################################################
23find_package(Doxygen)
24
25########################################################################
26# Begin conditional configuration
27########################################################################
28if(ENABLE_DOXYGEN)
29
30########################################################################
31# Add subdirectories
32########################################################################
33add_subdirectory(doxygen)
34
35endif(ENABLE_DOXYGEN)
Petter Reinholdtsen863afc62017-09-13 09:22:23 +020036
37########################################################################
38# Convert manual pages from rst to roff and install them
39########################################################################
40find_program(RST2MAN_EXECUTABLE NAMES rst2man rst2man.py rst2man2 rst2man2.py)
Petter Reinholdtsen863afc62017-09-13 09:22:23 +020041
42function(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})
51endfunction()
52
Piotr Krysikfa2bb862017-09-23 21:38:08 +020053if(NOT RST2MAN_EXECUTABLE)
54 message(WARNING "rst2man from python-docutils is required to build man pages")
55else()
Vasil Velichkov45b04bb2019-09-09 23:04:28 +030056 build_man_page(MAN1_OUTPUT grgsm_livemon.rst grgsm_livemon.1)
Piotr Krysikdf417732020-02-16 08:58:28 +010057 install(
58 FILES
59 ${MAN1_OUTPUT}
60 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
61 )
Piotr Krysikfa2bb862017-09-23 21:38:08 +020062endif()
63
64