mirror of
https://github.com/kakwa/uts-server
synced 2025-01-10 13:44:29 +01:00
recover version directory from CMakeLists.txt
this avoid mistakes caused by double declaration of the version in CMakeLists.txt and conf.py
This commit is contained in:
parent
eb2b6ae66e
commit
1fd9126b0a
11
docs/conf.py
11
docs/conf.py
@ -16,9 +16,18 @@
|
|||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath('..'))
|
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 -----------------------------------------------------
|
# -- General configuration -----------------------------------------------------
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# 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 short X.Y version.
|
||||||
# The full version, including alpha/beta/rc tags.
|
# 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
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user