Skip to content

Add sphinx documentation #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
665918f
initial doc skeleton
cav71 May 11, 2018
5e2433f
initial doc skeleton
cav71 May 11, 2018
f2b6a5e
initial doc skeleton
cav71 May 11, 2018
4c741ff
Fix sqlite3 import by matching upstream build option for load_extension
ihnorton May 15, 2018
c3b8d53
Merge pull request #223 from ihnorton/fix_sqlite3
jcfr May 16, 2018
57e0d81
initial doc skeleton
cav71 May 11, 2018
e96b06c
initial doc skeleton
cav71 May 11, 2018
b7edef3
initial doc skeleton
cav71 May 11, 2018
e019f87
Merge branch 'add-sphinx' of https://github.com/cav71/python-cmake-bu…
cav71 May 17, 2018
9f41f2c
initial doc skeleton
cav71 May 11, 2018
6f46380
initial doc skeleton
cav71 May 11, 2018
dd70142
initial doc skeleton
cav71 May 11, 2018
f0174c5
Merge branch 'add-sphinx' of https://github.com/cav71/python-cmake-bu…
cav71 May 17, 2018
7edb496
uses the same scikit sphinx extensions
cav71 May 17, 2018
42b5ac0
initial doc skeleton
cav71 May 11, 2018
065b37c
initial doc skeleton
cav71 May 11, 2018
59cea94
initial doc skeleton
cav71 May 11, 2018
5254a59
uses the same scikit sphinx extensions
cav71 May 17, 2018
67d3fb4
Merge branch 'add-sphinx' of https://github.com/cav71/python-cmake-bu…
cav71 May 23, 2018
33cb63e
added cmake documentation
cav71 May 23, 2018
4ca0b6c
backport cpython document build script, align the conf.py to the cpyt…
cav71 May 23, 2018
357aad2
backport cpython document build script, align the cmakelib.py to the …
cav71 May 23, 2018
d49d231
added more documentation (backport from cpython)
cav71 May 23, 2018
9074319
update modules documentation
cav71 May 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added Doc/_static/.keepme
Empty file.
Empty file added Doc/_templates/.keepme
Empty file.
52 changes: 52 additions & 0 deletions Doc/cmake/cmake-modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Modifying CMakeList.txt and using cmake modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The central configuration cmake file is the ``CMakeLists.txt``, this is a Makefile equivalent,
with added funcionalities.

The ``CMakeLists.txt`` can import and use support modules (usually ending with the *.cmake* prefix and locate under the
main tree:

.. code-block:: shell-session

<python source directory>
├───CMakeLists.txt <- main cmake configuration file
├───cmake <- ``CMakeLists.txt`` support files
├───Doc
│ ├───cmake <- cmake documentation
│ ├───tutorial
│ ├───using
│ └───whatsnew
├───Grammar
├───Include
.....
├───Python
│ └───clinic
└───Tools


``CMakeLists.txt``

To facilitate the writing of ``CMakeLists.txt`` cmake modules can be used. In order to make
use of them, it is necessary to include them using the cmake command ``find_package`` from within ``CMakeLists.txt``:

.. code-block:: cmake

include(cmake/CMakeChecks.cmake)


List of support modules
~~~~~~~~~~~~~~~~~~~~~~~

For more details, see each module documentation.

.. toctree::
:maxdepth: 2

modules/CheckCMakeCommandExists
modules/CMakeChecks
modules/PythonApplyPatches




54 changes: 54 additions & 0 deletions Doc/cmake/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.. _cmake-index:

###############################
Building the python interpreter
###############################

This is the documentation for the `CMake <https://cmake.org>`_-based buildsystem.

There are two parts to this document:

#. instructions for python developer (**Build instructions**)
#. documenttaion for **extending the build tool itself**

In both cases you need to `download <https://cmake.org/download>`_ and install cmake.


Build instructions
------------------

On Unix, Linux, BSD, macOS, and Cygwin::

mkdir build
cd build
cmake ..
make


On Windows:

.. code-block:: shell-session

md build
cd build
cmake -G "NMake Makefiles" ..
nmake


Extending the buildtool system
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The cmake base buildtool can be adapted and extended using the cmake syntax:

.. toctree::
:maxdepth: 2

cmake-modules


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
1 change: 1 addition & 0 deletions Doc/cmake/modules/CMakeChecks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. cmake-module:: ../../../cmake/CMakeChecks.cmake
1 change: 1 addition & 0 deletions Doc/cmake/modules/CheckCMakeCommandExists.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. cmake-module:: ../../../cmake/CheckCMakeCommandExists.cmake
1 change: 1 addition & 0 deletions Doc/cmake/modules/PythonApplyPatches.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. cmake-module:: ../../../cmake/PythonApplyPatches.cmake
159 changes: 159 additions & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import sys, os, time
sys.path.append(os.path.abspath('tools/extensions'))
sys.path.append(os.path.abspath('includes'))



# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'cmakelib',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'cmake/index'

# General information about the project.
project = 'python-cmake-buildsystem'
copyright = 'Whatever'
author = 'A. Cavallo'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0.0'
# The full version, including alpha/beta/rc tags.
release = '1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'default'


# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'python-cmake-buildsystem'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'python-cmake-buildsystem.tex', 'python-cmake-buildsystem Documentation',
'A. Cavallo', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'python-cmake-buildsystem', 'python-cmake-buildsystem Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'python-cmake-buildsystem', 'python-cmake-buildsystem Documentation',
author, 'python-cmake-buildsystem', 'One line description of project.',
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
Loading