This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
configure.sh
executable file
·154 lines (128 loc) · 3.19 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/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,
# 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_14_04 () {
apt-get update
apt-get -y install build-essential libgtkmm-3.0-dev checkinstall yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
INSTALLED=1
}
INSTALL_UBUNTU_16_04 () {
apt-get update
apt-get -y install libgtkmm-3.0-dev
INSTALLED=1
}
INSTALL_UBUNTU_18_04 () {
apt-get update
apt-get -y install pkg-config
apt-get -y install libgtkmm-3.0-dev
INSTALLED=1
}
INSTALL_MINT_18_2 () {
apt-get update
apt-get -y install pkg-config
apt-get -y install libgtkmm-3.0-dev
INSTALLED=1
}
INSTALL_DEBIAN_9 () {
apt-get update
apt-get -y install pkgconf
apt-get -y install libopencv-dev libgtkmm-3.0-dev
INSTALLED=1
}
INSTALL_BASE() {
apt-get update
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`
}
INSTALL_OPENCV () {
OpenCV_Version="$(pkg-config --modversion opencv)"
if [ "$OpenCV_Version" == "3.4.2" ]
then
return
fi
if [ ! -f "3.4.2.tar.gz" ]
then
wget https://github.com/opencv/opencv/archive/3.4.2.tar.gz
fi
if [ ! -d "opencv-3.4.2" ]
then
tar -xzvf 3.4.2.tar.gz
fi
cd opencv-3.4.2
mkdir -p build
cd build
cmake ..
make
make install
cd ..
cd ..
}
INIT_SUBMODULES() {
git submodule init;
git submodule update;
}
INSTALL () {
INSTALL_BASE;
INSTALL_OPENCV;
# 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" ]]; 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;