forked from Tulip-Dev/tulip
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtalipot-config.in
118 lines (108 loc) · 2.88 KB
/
talipot-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
#!/bin/bash
thisdir=$(dirname "$0")
if test "$thisdir" = "." ; then
thisdir=$PWD
fi
upthisdir=$(dirname ${thisdir})
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
sharedir=${prefix}/share
libversion=@libversion@
libextension=$(echo @CMAKE_SHARED_LIBRARY_SUFFIX@ | cut -d'.' -f 2)
plugincxxflags="-std=c++17 -fPIC -DPIC"
pluginldflags=-shared
pluginpath=@libdir@/talipot
if [ "@CMAKE_DEBUG_MODE@" = "FALSE" ]; then
ndebugflag=-DNDEBUG
fi
WINDOWS=$(test ${libextension} = dll; echo $?)
MACOSX=$(test ${libextension} = dylib; echo $?)
LINUX=$(test ${libextension} = so; echo $?)
# check for MacOS or Windows installation
if [ $MACOSX -eq 0 ] ; then
pluginldflags="-bundle -Wl,-bind_at_load -flat_namespace"
if [ -e ${upthisdir}/Frameworks/QtCore ] ; then
# MacOS bundle
includedir=${upthisdir}/include
libdir=${upthisdir}/Frameworks
pluginpath=${upthisdir}/lib/talipot
fi
fi
if [ $WINDOWS -eq 0 ] ; then
libversion=@WIN_VERSION@
plugincxxflags="-std=c++17 -DPIC"
if [ -f "${upthisdir}/Uninstall.exe" ] ; then
# Windows installation
drive=`echo ${thisdir} | awk -F / '{print $2}'`
ndir=${thisdir/\/$drive\//$drive:/}
if [ -d ${ndir} ]; then
thisdir=${ndir}
fi
includedir=${upthisdir}/include
libdir=${upthisdir}/bin
pluginpath=${upthisdir}/lib/talipot
else
pluginpath=${prefix}/lib/talipot
libdir=${prefix}/bin
fi
fi
usage()
{
cat <<EOF
Usage: talipot-config [OPTIONS]
Options:
--version (return the current version of Talipot)
--libs (return the whole Talipot libs)
--cxxflags (return the Talipot needed cxx flags)
--plugincxxflags (return the Talipot plugin cxx flags)
--pluginextension (return the plugin file extension)
--pluginldflags (return the plugin loader flags)
--pluginpath (return the path for installation of Talipot plugins)
--sharepath (return the path where share data are installed)
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
OUTPUT=
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--version)
OUTPUT=`echo ${OUTPUT} @VERSION@`
;;
--cxxflags)
OUTPUT=`echo ${OUTPUT} @CMAKE_CXX_FLAGS@ @OPENMP_CXX_FLAGS@ ${ndebugflag} -I${includedir} -I${includedir}/talipot`
;;
--libs)
OUTPUT=`echo ${OUTPUT} ${libdir}/libtalipot-core-${libversion}.${libextension} @CMAKE_SHARED_LINKER_FLAGS@ @OPENMP_CXX_FLAGS@`
;;
--plugincxxflags)
OUTPUT=`echo ${OUTPUT} ${plugincxxflags}`
;;
--pluginldflags)
OUTPUT=`echo ${OUTPUT} ${pluginldflags}`
;;
--pluginextension)
OUTPUT=`echo ${OUTPUT} ${libextension}`
;;
--pluginpath)
OUTPUT=`echo ${OUTPUT} ${pluginpath}`
;;
--sharepath)
OUTPUT=`echo ${OUTPUT} ${sharedir}`
;;
*)
usage
;;
esac
shift
done
echo ${OUTPUT}
exit 0