From 6963574a55152bcd475f86439e0453350da8e728 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 18 Sep 2010 10:37:51 +0000 Subject: scons now gets the blender version from BKE_blender.h. --- build_files/scons/tools/btools.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'build_files') 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): -- cgit v1.2.3