summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Modules/FindSphinx.cmake37
-rw-r--r--docs/CMakeLists.txt24
-rw-r--r--docs/doxygen/Doxyfile.in3
-rw-r--r--docs/sphinx/CMakeLists.txt35
-rw-r--r--docs/sphinx/Makefile130
-rw-r--r--docs/sphinx/run_sphinx_build.sh.in7
-rw-r--r--docs/sphinx/source/conf.py.in (renamed from docs/sphinx/source/conf.py)3
7 files changed, 106 insertions, 133 deletions
diff --git a/cmake/Modules/FindSphinx.cmake b/cmake/Modules/FindSphinx.cmake
new file mode 100644
index 000000000..da12ee93d
--- /dev/null
+++ b/cmake/Modules/FindSphinx.cmake
@@ -0,0 +1,37 @@
+# - This module looks for Sphinx
+# Find the Sphinx documentation generator
+#
+# This modules defines
+# SPHINX_EXECUTABLE
+# SPHINX_FOUND
+
+#=============================================================================
+# Copyright 2002-2009 Kitware, Inc.
+# Copyright 2009-2011 Peter Colberg
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file COPYING-CMAKE-SCRIPTS for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+find_program(SPHINX_EXECUTABLE NAMES sphinx-build
+ HINTS
+ $ENV{SPHINX_DIR}
+ PATH_SUFFIXES bin
+ DOC "Sphinx documentation generator"
+)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(Sphinx DEFAULT_MSG
+ SPHINX_EXECUTABLE
+)
+
+mark_as_advanced(
+ SPHINX_EXECUTABLE
+)
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index f67fdd7a8..24bf2405e 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -21,12 +21,14 @@
# Setup dependencies
########################################################################
find_package(Doxygen)
+find_package(Sphinx)
########################################################################
# Register component
########################################################################
include(GrComponent)
GR_REGISTER_COMPONENT("doxygen" ENABLE_DOXYGEN DOXYGEN_FOUND)
+GR_REGISTER_COMPONENT("sphinx" ENABLE_SPHINX SPHINX_FOUND)
########################################################################
# Begin conditional configuration
@@ -48,3 +50,25 @@ CPACK_COMPONENT("docs"
add_subdirectory(doxygen)
endif(ENABLE_DOXYGEN)
+
+
+########################################################################
+# Begin conditional configuration
+########################################################################
+if(ENABLE_SPHINX)
+
+########################################################################
+# Setup CPack components
+########################################################################
+include(GrPackage)
+CPACK_COMPONENT("docs"
+ DISPLAY_NAME "Documentation"
+ DESCRIPTION "Sphinx generated documentation"
+)
+
+########################################################################
+# Add subdirectories
+########################################################################
+add_subdirectory(sphinx)
+
+endif(ENABLE_SPHINX)
diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in
index f3485316c..ad3c2d01f 100644
--- a/docs/doxygen/Doxyfile.in
+++ b/docs/doxygen/Doxyfile.in
@@ -628,7 +628,6 @@ EXCLUDE = @abs_top_builddir@/docs/doxygen/html \
@abs_top_builddir@/gr-gsm-fr-vocoder/src/lib/gsm_full_rate.py \
@abs_top_builddir@/gr-gsm-fr-vocoder/src/python/encdec.py \
@abs_top_builddir@/gr-howto-write-a-block \
- @abs_top_builddir@/gr-howto-write-a-block-cmake \
@abs_top_builddir@/gr-pager/src/pager_swig.py \
@abs_top_builddir@/gr-trellis/doc \
@abs_top_builddir@/gr-trellis/src/lib/generate_all.py \
@@ -640,7 +639,7 @@ EXCLUDE = @abs_top_builddir@/docs/doxygen/html \
@abs_top_builddir@/_CPack_Packages \
@abs_top_srcdir@/cmake \
@abs_top_srcdir@/gr-qtgui/lib \
- @abs_top_srcdir@/gr-howto-write-a-block-cmake
+ @abs_top_srcdir@/gr-howto-write-a-block
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
diff --git a/docs/sphinx/CMakeLists.txt b/docs/sphinx/CMakeLists.txt
new file mode 100644
index 000000000..38d77fb3a
--- /dev/null
+++ b/docs/sphinx/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+include(GrPython)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/source/conf.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/conf.py
+@ONLY)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/run_sphinx_build.sh.in
+ ${CMAKE_BINARY_DIR}/run_sphinx_build.sh
+@ONLY)
+
+if(UNIX)
+ #make the shell file executable
+ execute_process(COMMAND chmod +x ${CMAKE_BINARY_DIR}/run_sphinx_build.sh)
+endif(UNIX)
diff --git a/docs/sphinx/Makefile b/docs/sphinx/Makefile
deleted file mode 100644
index 3fcbff238..000000000
--- a/docs/sphinx/Makefile
+++ /dev/null
@@ -1,130 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/GNURadio.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/GNURadio.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/GNURadio"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/GNURadio"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- make -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/sphinx/run_sphinx_build.sh.in b/docs/sphinx/run_sphinx_build.sh.in
new file mode 100644
index 000000000..bc89f2de7
--- /dev/null
+++ b/docs/sphinx/run_sphinx_build.sh.in
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+echo "Creating Sphinx documentation in: @CMAKE_CURRENT_BINARY_DIR@/sphinx_out"
+
+LD_LIBRARY_PATH="@CMAKE_INSTALL_PREFIX@/lib"
+@SPHINX_EXECUTABLE@ -b html -c @CMAKE_CURRENT_BINARY_DIR@/ @CMAKE_CURRENT_SOURCE_DIR@/source @CMAKE_CURRENT_BINARY_DIR@/sphinx_out
+
diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py.in
index f5422ee41..23a923a00 100644
--- a/docs/sphinx/source/conf.py
+++ b/docs/sphinx/source/conf.py.in
@@ -16,7 +16,8 @@ import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('..'))
+sys.path.insert(0, os.path.abspath('@CMAKE_CURRENT_SOURCE_DIR@'))
+sys.path.insert(0, '@CMAKE_INSTALL_PREFIX@/@GR_PYTHON_DIR@')
# -- General configuration -----------------------------------------------------