-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·92 lines (85 loc) · 1.81 KB
/
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
#!/bin/bash
#Preparing directories
mkdir -p ~/include/GL/
mkdir -p ~/lib/
mkdir -p build
cd build
platform=$(uname)
#Parsing arguments
if [ $# -gt 1 ]
then
echo "Usage : sh install.sh [-o]"
exit 1
fi
if [ $# -eq 1 ]
then
if [ $1 = "-o" ]
then
rm -rf ~/lib/libGraphicsEngine.*
rm -rf ~/lib/libCommons.*
rm -rf ~/lib/libGLEW.*
rm -rf ~/include/GraphicsEngine
rm -rf ~/include/glm
rm -rf ~/include/GL
else
echo "Usage : sh install.sh [-o]"
exit 1
fi
fi
#Installing glm
if [ ! -d ~/include/glm/ ]
then
echo "-- Installing glm"
git clone https://github.com/g-truc/glm.git glm
cd glm
cp -r ./glm ~/include/
cd -
rm -rf glm/
else
echo "-- glm already installed. Skipping..."
fi
#Installing glew
if [ ${platform} != "Darwin" ]
then
if [ \( ! -f ~/lib/libGLEW.so \) -a \( ! -f ~/lib/libGLEW.dylib \) ]
then
echo "-- Installing glew"
git clone https://github.com/nigels-com/glew.git glew
cd glew
make extensions
make
cp lib/libGLEW.so ~/lib/
cp include/GL/*.h ~/include/GL/
cd -
rm -rf glew/
else
echo "-- glew already installed. Skipping..."
fi
else
echo "-- Detected OS = " ${platform} ", skipping glew installation."
fi
#Installing Commons
if [ \( ! -f ~/lib/libCommons.so \) -a \( ! -f ~/lib/libCommons.dylib \) ]
then
echo "-- Installing Commons"
git clone https://github.com/ICStoolbox/Commons.git Commons
mkdir Commons/build
cd Commons/build
cmake ..
make install
cd -
rm -rf Commons/
else
echo "-- Commons already installed. Skipping..."
fi
#Installing GraphicsEngine
if [ \( ! -f ~/lib/libGraphicsEngine.so \) -a \( ! -f ~/lib/libGraphicsEngine.dylib \) ]
then
echo "-- Installing GraphicsEngine"
cmake ..
make
make install
else
echo "-- GraphicsEngine already installed. Skipping..."
fi
cd ../