-
Notifications
You must be signed in to change notification settings - Fork 0
/
HepMC3-config.in
executable file
·123 lines (103 loc) · 4.8 KB
/
HepMC3-config.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
#Adopted from
#https://yoda.hepforge.org/trac/browser/bin/yoda-config.in
#Docs from https://cmake.org/cmake/help/v3.2/command/configure_file.html
## @configure_input@
#The line below assures at least some relocation.
if [ "$(uname)" == "Darwin" ]; then
# greadlink is only available through 'brew install coreutils'
if [ ! -z "$(command -v greadlink)" ]; then
PACKAGE_BIN_DIR=$(dirname $(greadlink -f $0))
else
PACKAGE_BIN_DIR=$(dirname $(readlink -f $0))
fi
else
PACKAGE_BIN_DIR=$(dirname $(readlink -f $0))
fi
PACKAGE_PREFIX_DIR=$(dirname ${PACKAGE_BIN_DIR})
tmp=$(echo $* | egrep -- '--\<help\>|-\<h\>')
if test $# -eq 0 || test -n "$tmp"; then
echo "@PROJECT_NAME@-config: configuration tool for the @PROJECT_NAME@ library"
echo
echo "Note: the portability of this script is limited, it does not expose all features of @PROJECT_NAME@."
echo "It is recommended to use cmake for builds with @PROJECT_NAME@ to reach a reasonable portability and"
echo "make sure all @PROJECT_NAME@ features can be used. This script might be deleted in the future."
echo
echo "Usage: $( basename $0 ) [--help|-h] | "
echo " [--{prefix,libdir,includedir,interfacesdir}] | "
echo " [--{cxxflags,ldflags,libs}] | "
echo " [--version]"
echo "Options:"
echo " --help | -h : show this help message"
echo
echo " --prefix : show the installation prefix"
echo " --includedir : show the path to the directory containing the @PROJECT_NAME@ headers"
echo " --libdir : show the path to the directory containing the @PROJECT_NAME@ libraries"
echo " --interfacesdir : show the path to the directory containing the interfaces to @PROJECT_NAME@"
echo
echo " --cflags|--cppflags : returns a '-I' string for insertion into CPPFLAGS or CXXFLAGS"
echo " --ldflags|--libs : returns a '-L/-l' string for insertion into LIBS or LIBADD"
echo " --rootIO : returns a '-L/-l' string for insertion into LIBS or LIBADD with rootIO support"
echo " --protobufIO : returns a '-L/-l' string for insertion into LIBS or LIBADD with protobufIO support"
echo " --search : returns a '-L/-l' string for insertion into LIBS or LIBADD with search support"
echo " --static : returns a string for insertion into LIBS or LIBADD"
echo
echo " --features : returns the list of enabled features in this HepMC3 build"
echo " --version : returns the @PROJECT_NAME@ release version number"
exit 0
fi
OUT=""
tmp=$( echo "$*" | egrep -- '--\<prefix\>')
test -n "$tmp" && OUT="$OUT ${PACKAGE_PREFIX_DIR}"
tmp=$( echo "$*" | egrep -- '--\<includedir\>')
test -n "$tmp" && OUT="$OUT @PACKAGE_CMAKE_INSTALL_INCLUDEDIR@"
tmp=$( echo "$*" | egrep -- '--\<libdir\>')
test -n "$tmp" && OUT="$OUT @PACKAGE_CMAKE_INSTALL_LIBDIR@"
tmp=$( echo "$*" | egrep -- '--\<interfacesdir\>')
test -n "$tmp" && OUT="$OUT @PACKAGE_INTERFACES_INSTALL_DIR@"
tmp=$( echo "$*" | egrep -- '--\<cflags|cppflags|cxxflags\>')
test -n "$tmp" && OUT="$OUT -I@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@"
tmp=$( echo "$*" | egrep -- '--\<static\>')
if test -n "$tmp"; then
st=$( echo "@HEPMC3_FEATURES@" | egrep -w -- 'lib_static')
test -n "$st"; then
tmp=$( echo "$*" | egrep -- '--\<ldflags|libs\>')
OUT="$OUT @PACKAGE_CMAKE_INSTALL_LIBDIR@/libHepMC3-static.a"
fi
st=$( echo "@HEPMC3_FEATURES@" | egrep -w -- 'search_static')
test -n "$st"; then
tmp=$( echo "$*" | egrep -- '--\<search\>')
test -n "$tmp" && OUT="$OUT @PACKAGE_CMAKE_INSTALL_LIBDIR@/libHepMC3search-static.a"
fi
st=$( echo "@HEPMC3_FEATURES@" | egrep -w -- 'protobufIO_static')
test -n "$st"; then
tmp=$( echo "$*" | egrep -- '--\<protobufIO\>')
test -n "$tmp" && OUT="$OUT @PACKAGE_CMAKE_INSTALL_LIBDIR@/libHepMC3protobufIO_static.a"
fi
else
st=$( echo "@HEPMC3_FEATURES@" | egrep -w -- 'lib')
test -n "$st"; then
tmp=$( echo "$*" | egrep -- '--\<ldflags|libs\>')
test -n "$tmp" && OUT="$OUT -L@PACKAGE_CMAKE_INSTALL_LIBDIR@ -lHepMC3"
fi
st=$( echo "@HEPMC3_FEATURES@" | egrep -w -- 'search')
test -n "$st"; then
tmp=$( echo "$*" | egrep -- '--\<search\>')
test -n "$tmp" && OUT="$OUT -L@PACKAGE_CMAKE_INSTALL_LIBDIR@ -lHepMC3search"
fi
st=$( echo "@HEPMC3_FEATURES@" | egrep -w -- 'protobufIO')
test -n "$st"; then
tmp=$( echo "$*" | egrep -- '--\<protobufIO\>')
test -n "$tmp" && OUT="$OUT -L@PACKAGE_CMAKE_INSTALL_LIBDIR@ -lHepMC3protobufIO"
fi
st=$( echo "@HEPMC3_FEATURES@" | egrep -w -- 'rootIO')
test -n "$st"; then
tmp=$( echo "$*" | egrep -- '--\<rootIO\>')
test -n "$tmp" && OUT="$OUT -L@PACKAGE_HEPMC3_ROOTIO_INSTALL_LIBDIR@ -lHepMC3rootIO"
fi
fi
tmp=$( echo "$*" | egrep -- '--\<features\>')
test -n "$tmp" && OUT="$OUT @HEPMC3_FEATURES@"
tmp=$( echo "$*" | egrep -- '--\<version\>')
test -n "$tmp" && echo @PROJECT_VERSION@ && exit 0
echo $OUT