summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wscript17
1 files changed, 16 insertions, 1 deletions
diff --git a/wscript b/wscript
index 92282c5..ff44e84 100644
--- a/wscript
+++ b/wscript
@@ -1,11 +1,21 @@
import subprocess
+import shlex
import os
import sys
import distutils.spawn
from waflib import Logs
APPNAME = 'libasdcp-cth'
-VERSION = '2.5.11-cth1'
+
+if os.path.exists('.git'):
+ this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
+ last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+ if this_version == '':
+ VERSION = '%sdevel' % last_version[1:].strip()
+ else:
+ VERSION = this_version[1:].strip()
+else:
+ VERSION = open('VERSION').read().strip()
def options(opt):
opt.load('compiler_cxx')
@@ -93,3 +103,8 @@ def post(ctx):
def tags(bld):
os.system('etags src/*.cc src/*.h')
+
+def dist(bld):
+ f = open('VERSION', 'w')
+ print>>f,VERSION
+ f.close()