Gaudi Framework, version v23r2

Home   Generated: Thu Jun 28 2012
Functions

createProjVersHeader Namespace Reference

Functions

def main

Function Documentation

def createProjVersHeader::main (  )

Definition at line 1 of file createProjVersHeader.py.

00002           :
00003     import os, sys, re
00004     if len(sys.argv) != 4:
00005         print "ERROR: Usage %s <project> <version> <outputfile>"%sys.argv[0]
00006         exit(1)
00007 
00008     project, version, outputfile = sys.argv[1:]
00009     print "Creating %s for %s %s"%(outputfile, project, version)
00010 
00011     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)
00012     majver = int(m.groupdict()['maj_ver'])
00013     minver = int(m.groupdict()['min_ver'])
00014     patver = int(m.groupdict()['pat_ver'] or 0)
00015 
00016     outdir = os.path.dirname(outputfile)
00017     if not os.path.exists(outdir):
00018         print "Creating directory", outdir
00019         os.makedirs(outdir)
00020 
00021     open(outputfile,"w").write(
00022     """#ifndef %(proj)s_VERSION
00023 /* Automatically generated file: do not modify! */
00024 #ifndef CALC_GAUDI_VERSION
00025 #define CALC_GAUDI_VERSION(maj,min) (((maj) << 16) + (min))
00026 #endif
00027 #define %(proj)s_MAJOR_VERSION %(maj)d
00028 #define %(proj)s_MINOR_VERSION %(min)d
00029 #define %(proj)s_PATCH_VERSION %(pat)d
00030 #define %(proj)s_VERSION CALC_GAUDI_VERSION(%(proj)s_MAJOR_VERSION,%(proj)s_MINOR_VERSION)
00031 #endif
00032 """%{ 'proj': project.upper(), 'min': minver, 'maj': majver, 'pat': patver })

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Thu Jun 28 2012 23:27:47 for Gaudi Framework, version v23r2 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004