[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31997] trunk/blender/build_files/scons/ tools/btools.py: scons now gets the blender version from BKE_blender.h.

Campbell Barton ideasman42 at gmail.com
Sat Sep 18 12:37:51 CEST 2010


Revision: 31997
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31997
Author:   campbellbarton
Date:     2010-09-18 12:37:51 +0200 (Sat, 18 Sep 2010)

Log Message:
-----------
scons now gets the blender version from BKE_blender.h.

Modified Paths:
--------------
    trunk/blender/build_files/scons/tools/btools.py

Modified: trunk/blender/build_files/scons/tools/btools.py
===================================================================
--- trunk/blender/build_files/scons/tools/btools.py	2010-09-18 08:49:03 UTC (rev 31996)
+++ trunk/blender/build_files/scons/tools/btools.py	2010-09-18 10:37:51 UTC (rev 31997)
@@ -15,8 +15,16 @@
 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):
         for k,v in args.iteritems():





More information about the Bf-blender-cvs mailing list