-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathinit.sh
executable file
·64 lines (53 loc) · 1.88 KB
/
init.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
#!/usr/bin/env bash
# Copyright 2018 Slightech Co., Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# _VERBOSE_=1
# _INIT_LINTER_=1
# _INIT_COMMITIZEN_=1
# _FORCE_INSRALL_=1
_INSTALL_OPTIONS_=$@
BASE_DIR=$(cd "$(dirname "$0")" && pwd)
source "$BASE_DIR/init_tools.sh"
## config permission
if [ "$HOST_OS" = "Linux" ]; then
source "$BASE_DIR/permissions.sh"
fi
## deps
_echo_s "Init deps"
if [ "$HOST_OS" = "Linux" ]; then
_install_deps "$SUDO apt-get install" libv4l-dev libjpeg-dev libgtk-3-dev libusb-dev
elif [ "$HOST_OS" = "Mac" ]; then
_install_deps "brew install" libuvc
elif [ "$HOST_OS" = "Win" ]; then
# _install_deps "pacman -S" ?
_echo
else # unexpected
_echo_e "Unknown host os :("
exit 1
fi
## cmake version
_cmake_version=`cmake --version | head -1`
_cmake_version=${_cmake_version#*version}
_cmake_version_major=`echo ${_cmake_version} | cut -d'.' -f1`
if [ "$_cmake_version_major" -lt "3" ]; then
_echo_s "Expect cmake version >= 3.0.0"
if [ "$HOST_NAME" = "Ubuntu" ]; then
# sudo apt remove cmake
_echo "How to upgrade cmake in Ubuntu"
_echo " https://askubuntu.com/questions/829310/how-to-upgrade-cmake-in-ubuntu"
fi
fi
_echo_s " "
_echo_s "Note:: Because of the problem of device permissions, you must reinsert the camera device after the command is executed and on the same computer, this operation only needs to be done once.."
exit 0