-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·52 lines (46 loc) · 1.24 KB
/
run.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
set -e
# Test for cmake:
if ! [ -x "$(command -v cmake)" ]; then
read -p "cmake not found (required to configure the build)! Install? (y/n) " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get update
sudo apt-get install cmake
fi
fi
# Test for python:
if ! [ -x "$(command -v python)" ]; then
read -p "python not found (required to execute the demo app)! Install? (y/n) " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get update
sudo apt-get install python
fi
fi
# Test for gcc
if ! [ -x "$(command -v gcc)" ]; then
read -p "gcc not found (required to compile the sources)! Install? (y/n) " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get update
sudo apt-get install build-essential
fi
fi
pkgs='qtbase5-dev pyqt5-dev'
if ! dpkg -s $pkgs >/dev/null 2>&1; then
read -p "One or all of {$pkgs} not found (compilation dependencies)! Install? (y/n) " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get update
sudo apt-get install $pkgs
fi
fi
# Compile:
mkdir -p build
cd build
cmake ..
make -j2
cd ..
# Run:
./build/shared_memory_cpp &
./shared_memory.py