-
Notifications
You must be signed in to change notification settings - Fork 5
/
conan_export_install.sh
executable file
·99 lines (85 loc) · 1.55 KB
/
conan_export_install.sh
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
#!/bin/bash
UNAME=$(tr [A-Z] [a-z] <<< "$(uname)")
export SCRIPTS_DIR="$( cd "$( echo "${BASH_SOURCE[0]%/*}/" )"; pwd )"
while getopts "d:l:i:o:e:c:f:b:l:" opt; do
case ${opt} in
o)
OPTIM_SPEC=$OPTARG
;;
c)
COMPILER=$OPTARG
;;
e)
COMPUTE_ENGINE=$OPTARG
;;
b)
BUILD_TYPE=$OPTARG
;;
l)
CONAN_CHANNEL=$OPTARG
;;
f)
CONANFILE_TXT=$OPTARG
;;
d)
CONAN_FILE_BASE_DIR=$OPTARG
;;
i)
LIBS_TO_EXPORT=$OPTARG
;;
\?)
echo "Invalid option: $OPTARG" 1>&2
exit 1
;;
:)
echo "Invalid option: $OPTARG requires an argument" 1>&2
;;
esac
done
shift $((OPTIND -1))
ARGS=""
if [ "x$CONAN_FILE_BASE_DIR" != "x" ]
then
ARGS="${ARGS} -d ${CONAN_FILE_BASE_DIR}"
fi
if [ "x$CONAN_CHANNEL" != "x" ]
then
ARGS="${ARGS} -l ${CONAN_CHANNEL}"
fi
if [ "x$LIBS_TO_EXPORT" != "x" ]
then
ARGS="${ARGS} -i ${LIBS_TO_EXPORT}"
fi
${SCRIPTS_DIR}/conan_export.sh ${ARGS}
ret=$?
if [[ ${ret} -eq "0" ]]
then
ARGS=""
if [ "x$OPTIM_SPEC" != "x" ]
then
ARGS="${ARGS} -o ${OPTIM_SPEC}"
fi
if [ "x$COMPILER" != "x" ]
then
ARGS="${ARGS} -c ${COMPILER}"
fi
if [ "x$COMPUTE_ENGINE" != "x" ]
then
ARGS="${ARGS} -e ${COMPUTE_ENGINE}"
fi
if [ "x$BUILD_TYPE" != "x" ]
then
ARGS="${ARGS} -b ${BUILD_TYPE}"
fi
if [ "x$CONAN_CHANNEL" != "x" ]
then
ARGS="${ARGS} -l ${CONAN_CHANNEL}"
fi
if [ "x$CONANFILE_TXT" != "x" ]
then
ARGS="${ARGS} -f ${CONANFILE_TXT}"
fi
${SCRIPTS_DIR}/conan_install.sh ${ARGS}
ret=$?
fi
exit ${ret}