diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-18 14:37:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-18 14:37:51 +0400 |
commit | 6963574a55152bcd475f86439e0453350da8e728 (patch) | |
tree | e803f11d995ff572743000ba94d6d793578c3790 | |
parent | 90b57077ccdc959b89ed1507cc067e89b53cc6fc (diff) |
scons now gets the blender version from BKE_blender.h.
-rw-r--r-- | build_files/scons/tools/btools.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index 5c4a4c527d5..563b3d42f5c 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -15,7 +15,15 @@ import sys Variables = SCons.Variables BoolVariable = SCons.Variables.BoolVariable -VERSION = '2.54' # This is used in creating the local config directories +def get_version(): + fname = os.path.join(os.path.dirname(__file__), "..", "..", "..", "source", "blender", "blenkernel", "BKE_blender.h") + for l in open(fname, "r"): + if "BLENDER_VERSION" in l: + ver = int(l.split()[-1]) + return "%d.%d" % (ver / 100, ver % 100) + raise Exception("%s: missing version string" % fname) + +VERSION = get_version() # This is used in creating the local config directories def print_arguments(args, bc): if len(args): |