summaryrefslogtreecommitdiffstats
path: root/docs/conf.py
blob: 44fbb14678581e7d3a04513d8362a324529742e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-

import re

def get_version():
    patterns = [
            r'^set\(UCA_VERSION_MAJOR "(\d*)"\)',
            r'^set\(UCA_VERSION_MINOR "(\d*)"\)',
            r'^set\(UCA_VERSION_PATCH "(\d*)"\)'
            ]
    version = ["0", "0", "0"]

    with open('../CMakeLists.txt', 'r') as f:
        lines = f.readlines()
        major_pattern = r'^set\(UCA_VERSION_MAJOR "(\d*)"\)'

        for line in lines:
            for i, pattern in enumerate(patterns):
                m = re.match(pattern, line)

                if m:
                    version[i] = m.group(1)

    return '.'.join(version)

source_suffix = '.rst'
master_doc = 'index'

project = u'libuca'
copyright = u'2014, Matthias Vogelgesang'

version = get_version()
release = version

exclude_patterns = ['_build']
pygments_style = 'sphinx'

html_theme = 'default'

htmlhelp_basename = 'libucadoc'

latex_documents = [
  ('index', 'libuca.tex', u'libuca Documentation',
   u'Matthias Vogelgesang', 'manual'),
]

man_pages = [
    ('index', 'libuca', u'libuca Documentation',
     [u'Matthias Vogelgesang'], 1)
]