diff --git a/docs/conf.py b/docs/conf.py index e2cf2f7..ef94c55 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,9 +16,18 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. import os import sys +import re sys.path.insert(0, os.path.abspath('..')) +def get_version(): + cmake = os.path.join(os.path.dirname(__file__),'../CMakeLists.txt') + with open(cmake) as f: + for line in f.readlines(): + m = re.search('set\(VERSION ([\.0-9]+)\)', line) + if m: + return m.group(1) + # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -50,7 +59,7 @@ copyright = u'2016, Pierre-Francois Carpentier' # # The short X.Y version. # The full version, including alpha/beta/rc tags. -release = '0.0.2' +release = get_version() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.