-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-header.in
47 lines (41 loc) · 1.54 KB
/
build-header.in
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