File: HepMC3-config.in

package info (click to toggle)
hepmc3 3.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 14,116 kB
  • sloc: fortran: 66,849; cpp: 13,604; ansic: 1,374; xml: 109; sh: 72; makefile: 33
file content (75 lines) | stat: -rwxr-xr-x 2,985 bytes parent folder | download
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
#!/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
prefix=$(dirname $(dirname $(greadlink -f  $0)))
else
prefix=$(dirname $(dirname $(readlink -f  $0)))
fi
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 "Usage: $( basename $0 ) [--help|-h] | "
    echo "           [--{prefix,libdir,includedir}] | "
    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
    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 "  --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 "  --version           : returns the ${PROJECT_NAME} release version number"
    exit 0
fi

OUT=""

tmp=$( echo "$*" | egrep -- '--\<prefix\>')
test -n "$tmp" && OUT="$OUT $prefix"

tmp=$( echo "$*" | egrep -- '--\<includedir\>')
test -n "$tmp" && OUT="$OUT $prefix/${CMAKE_INSTALL_INCLUDEDIR}"

tmp=$( echo "$*" | egrep -- '--\<libdir\>')
test -n "$tmp" && OUT="$OUT $prefix/${CMAKE_INSTALL_LIBDIR}"

tmp=$( echo "$*" | egrep -- '--\<cflags|cppflags|cxxflags\>')
test -n "$tmp" && OUT="$OUT -I$prefix/${CMAKE_INSTALL_INCLUDEDIR}"


tmp=$( echo "$*" | egrep -- '--\<static\>')
if test -n "$tmp"; then 

tmp=$( echo "$*" | egrep -- '--\<ldflags|libs\>')
OUT="$OUT $prefix/${CMAKE_INSTALL_LIBDIR}/libHepMC3_static.a -lHepMC3"

tmp=$( echo "$*" | egrep -- '--\<search\>')
test -n "$tmp" && OUT="$OUT -L$prefix/${CMAKE_INSTALL_LIBDIR}/libHepMC3search_static.a -lHepMC3search"

else 
tmp=$( echo "$*" | egrep -- '--\<ldflags|libs\>')
test -n "$tmp" && OUT="$OUT -L$prefix/${CMAKE_INSTALL_LIBDIR} -lHepMC3"

tmp=$( echo "$*" | egrep -- '--\<search\>')
test -n "$tmp" && OUT="$OUT -L$prefix/${CMAKE_INSTALL_LIBDIR} -lHepMC3search"
fi

tmp=$( echo "$*" | egrep -- '--\<rootIO\>')
test -n "$tmp" && OUT="$OUT -L$prefix/${CMAKE_INSTALL_LIBDIR}  ${HEPMC3_ROOTIO_LIBRARY}"

tmp=$( echo "$*" | egrep -- '--\<version\>')
test -n "$tmp" && echo ${PROJECT_VERSION}&& exit 0

echo $OUT