forked from VSS-SDK/VSS-Simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·128 lines (106 loc) · 2.51 KB
/
configure.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
#
# This file is part of the VSS-SDK project.
#
# This Source Code Form is subject to the terms of the GNU GENERAL PUBLIC LICENSE.txt,
# v. 3.0. If a copy of the GPL was not distributed with this
# file, You can obtain one at http://www.gnu.org/licenses/gpl-3.0/.
#
DISTRO=``
RELEASE=``
RELEASE_DEBIAN=``
ARCHITECTURE=``
COMPILE_TYPE=$1
INSTALLED=0
CMAKE () {
rm -R build
mkdir -p build
cd build
cmake ..
make
cd ..
}
CMAKE_INSTALL () {
rm -R build
mkdir -p build
cd build
cmake -D RELEASE=ON ..
make install
cd ..
}
INSTALL_UBUNTU_18_04 () {
apt-get update && apt-get upgrade
apt-get -y install pkg-config
apt-get -y install libbullet-dev
INSTALLED=1
}
INSTALL_UBUNTU_16_04 () {
apt-get update && apt-get upgrade
apt-get -y install pkg-config
apt-get -y install libbullet-dev
INSTALLED=1
}
INSTALL_UBUNTU_14_04 () {
apt-get update && apt-get upgrade
apt-get -y install pkg-config
apt-get -y install libbullet-dev
INSTALLED=1
}
INSTALL_MINT_18_2 () {
apt-get update && apt-get upgrade
apt-get -y install pkg-config
apt-get -y install libbullet-dev
INSTALLED=1
}
INSTALL_DEBIAN_9 () {
apt-get update && apt-get upgrade
apt-get -y install pkgconf
apt-get -y install libbullet-dev
INSTALLED=1
}
INSTALL_BASE() {
apt-get update && apt-get upgrade
apt-get -y install lsb-release;
DISTRO=`lsb_release -si`
RELEASE=`lsb_release -sr`
RELEASE_DEBIAN=`lsb_release -sr | cut -c1-1`
ARCHITECTURE=`uname -m`
}
INIT_SUBMODULES() {
git submodule init;
git submodule update;
}
INSTALL () {
INSTALL_BASE;
# Ubuntu
if [[ "$DISTRO" == "Ubuntu" ]] && [[ "$RELEASE" == "18.04" ]]; then
INSTALL_UBUNTU_18_04;
fi
if [[ "$DISTRO" == "Ubuntu" ]] && [[ "$RELEASE" == "16.04" ]]; then
INSTALL_UBUNTU_16_04;
fi
if [[ "$DISTRO" == "Ubuntu" ]] && [[ "$RELEASE" == "14.04" ]]; then
INSTALL_UBUNTU_14_04;
fi
# Debian
if [[ "$DISTRO" == "Debian" ]] && [[ "$RELEASE_DEBIAN" == "9" ]]; then
INSTALL_DEBIAN_9;
fi
# LinuxMint
if [[ "$DISTRO" == "LinuxMint" ]] && [[ "$RELEASE" == "18.2" ]]; then
INSTALL_MINT_18_2;
fi
if [[ $INSTALLED == 0 ]]; then
echo "Sistema Operacional Incompatível";
fi
if [[ $INSTALLED == 1 ]]; then
INIT_SUBMODULES;
if [[ $COMPILE_TYPE == "development" ]];
then
CMAKE;
else
CMAKE_INSTALL;
fi
fi
}
INSTALL;