Gaudi Framework, version v23r0

Home   Generated: Mon Jan 30 2012

createProjVersHeader.py

Go to the documentation of this file.
00001 def main():
00002     import os, sys, re
00003     if len(sys.argv) != 4:
00004         print "ERROR: Usage %s <project> <version> <outputfile>"%sys.argv[0]
00005         exit(1)
00006 
00007     project, version, outputfile = sys.argv[1:]
00008     print "Creating %s for %s %s"%(outputfile, project, version)
00009 
00010     m = re.match("(v|([A-Za-z]+\-))(?P<maj_ver>[0-9]+)(r|\-)(?P<min_ver>[0-9]+)(?:(p|\-)(?P<pat_ver>[0-9]+))?",version)
00011     majver = int(m.groupdict()['maj_ver'])
00012     minver = int(m.groupdict()['min_ver'])
00013     patver = int(m.groupdict()['pat_ver'] or 0)
00014 
00015     outdir = os.path.dirname(outputfile)
00016     if not os.path.exists(outdir):
00017         print "Creating directory", outdir
00018         os.makedirs(outdir)
00019 
00020     open(outputfile,"w").write(
00021     """#ifndef %(proj)s_VERSION
00022 /* Automatically generated file: do not modify! */
00023 #ifndef CALC_GAUDI_VERSION
00024 #define CALC_GAUDI_VERSION(maj,min) (((maj) << 16) + (min))
00025 #endif
00026 #define %(proj)s_MAJOR_VERSION %(maj)d
00027 #define %(proj)s_MINOR_VERSION %(min)d
00028 #define %(proj)s_PATCH_VERSION %(pat)d
00029 #define %(proj)s_VERSION CALC_GAUDI_VERSION(%(proj)s_MAJOR_VERSION,%(proj)s_MINOR_VERSION)
00030 #endif
00031 """%{ 'proj': project.upper(), 'min': minver, 'maj': majver, 'pat': patver })
00032 
00033 if __name__ == "__main__":
00034     main()
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Jan 30 2012 13:53:01 for Gaudi Framework, version v23r0 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004