Pass version from CMake to Sphinx

This commit is contained in:
vitaut
2015-11-23 08:10:02 -08:00
parent 646829e34d
commit b83fd00183
5 changed files with 20 additions and 22 deletions

View File

@@ -47,7 +47,7 @@ source_suffix = '.rst'
# General information about the project.
project = u'C++ Format'
copyright = u'2012-2014, Victor Zverovich'
copyright = u'2012-2015, Victor Zverovich'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -55,15 +55,11 @@ copyright = u'2012-2014, Victor Zverovich'
#
# The short X.Y version.
# Get version from CMakeLists.txt.
with open('../CMakeLists.txt') as f:
for line in f:
m = re.match(r'set\(CPPFORMAT_VERSION (.+)\)', line.strip())
if m:
version = m.group(1)
# Version and release are passed from CMake.
#version = None
# The full version, including alpha/beta/rc tags.
release = version
#release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.