File: build-header.in

package info (click to toggle)
clhep 2.1.4.1+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 10,004 kB
  • sloc: cpp: 50,094; sh: 6,694; makefile: 2,691; perl: 28
file content (47 lines) | stat: -rw-r--r-- 1,575 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /bin/sh
# @configure_input@
#
#  This script creates ClhepVersion.h
#
rm -f ClhepVersion.h

VERSION="@VERSION@"

# decode the version number

v1=`echo $VERSION | awk -F\. '{ print $1 }'`
v2=`echo $VERSION | awk -F\. '{ print $2 }'`
v3=`echo $VERSION | awk -F\. '{ print $3 }'`
v4=`echo $VERSION | awk -F\. '{ print $4 }'`


rm -f ClhepVersion.h
echo "#ifndef CLHEP_VERSION_H" >> ClhepVersion.h
echo "#define CLHEP_VERSION_H 1" >> ClhepVersion.h
echo "//" >> ClhepVersion.h
echo "// ClhepVersion.h" >> ClhepVersion.h
echo "//" >> ClhepVersion.h
echo "// Sample Usage:" >> ClhepVersion.h
echo "//   std::string version = CLHEP::Version::String()" >> ClhepVersion.h
echo "//   int mjr = CLHEP::Version::Major();" >> ClhepVersion.h
echo "//" >> ClhepVersion.h
echo "" >> ClhepVersion.h
echo "#include <string>" >> ClhepVersion.h
echo "" >> ClhepVersion.h
echo "namespace CLHEP {" >> ClhepVersion.h
echo "" >> ClhepVersion.h
echo "  struct Version {" >> ClhepVersion.h
echo "" >> ClhepVersion.h
echo "    static std::string String() { return \"$VERSION\"; }" >> ClhepVersion.h
echo "    static int Major()          { return $v1; }" >> ClhepVersion.h
echo "    static int SubMajor()       { return $v2; }" >> ClhepVersion.h
echo "    static int Minor()          { return $v3; }" >> ClhepVersion.h
echo "    static int SubMinor()       { return $v4; }" >> ClhepVersion.h
echo "" >> ClhepVersion.h
echo "  };" >> ClhepVersion.h
echo "" >> ClhepVersion.h
echo "} // namespace" >> ClhepVersion.h
echo "" >> ClhepVersion.h
echo "#endif  // CLHEP_VERSION_H" >> ClhepVersion.h

exit 0