Mercurial > hg > orthanc-postgresql
view Resources/Platforms/PrepareCMakeConfigurationFile.py @ 161:6c94a727758c
Fix issue #68 (PostgreSQL plugin needs extra flags to compile)
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Fri, 05 Jan 2018 10:57:39 +0100 |
| parents | 171da992b0a5 |
| children |
line wrap: on
line source
#!/usr/bin/python import re import sys if len(sys.argv) != 3: raise Exception('Bad number of arguments') r = re.compile(r'^#undef ([A-Z0-9_]+)$') with open(sys.argv[1], 'r') as f: with open(sys.argv[2], 'w') as g: for l in f.readlines(): m = r.match(l) if m != None: s = m.group(1) g.write('#cmakedefine %s @%s@\n' % (s, s)) else: g.write(l)
