blob: 041fc60bae8738d2cc799403335e800b0e97a8ec [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)
41if(NOT RST2MAN_EXECUTABLE)
42 message(FATAL "rst2man from python-docutils is required to build man pages")
43endif()
44
45function(BUILD_MAN_PAGE _sources _src _dst)
46 add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_dst}"
47 COMMAND ${RST2MAN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_src} ${CMAKE_CURRENT_BINARY_DIR}/${_dst}
48 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_src})
49
50 list(APPEND ${_sources} "${CMAKE_CURRENT_BINARY_DIR}/${_dst}")
51 set(${_sources} ${${_sources}} PARENT_SCOPE)
52
53 add_custom_target(man_${_src} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_dst})
54endfunction()
55
56build_man_page(MAN1_OUTPUT grgsm_livemon.rst grgsm_livemon.1)
57install(FILES ${MAN1_OUTPUT} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)