-
Notifications
You must be signed in to change notification settings - Fork 4
/
install_dependencies.sh
executable file
·67 lines (49 loc) · 1.85 KB
/
install_dependencies.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
#!/bin/bash
set -e #abort with error if any command returns with something other than zero
############
# Install script for v3dd dependencies
# Run "$> sudo ./install_dependencies.sh" to install system wide
# Run "$> ./install_dependencies.sh <path_to_prefix>" to install to a local prefix
############
function build {
if [ -d $3 ]
then
echo "Directory $3 already exists. "
read -r -p "Do you want to delete and re-download $3? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
rm -rf $3
else
echo "Aborting!"
exit -1
fi
fi
git clone --branch $2 $1 $3
mkdir $3/build
cd $3/build
cmake .. $4
make install
cd ../../
}
PREFIX=""
ABS_PREFIX=""
if [ "$#" -eq 1 ]; then
ABS_PREFIX=`readlink -f $1`
PREFIX="-DCMAKE_INSTALL_PREFIX=$ABS_PREFIX"
echo "" > env.sh #create empty env.sh
echo "export CMAKE_PREFIX_PATH=$ABS_PREFIX" >> env.sh
echo "export PKG_CONFIG_PATH=$ABS_PREFIX/lib/pkgconfig:$ABS_PREFIX/share/pkgconfig:$ABS_PREFIX/lib64/pkgconfig:\$PKG_CONFIG_PATH" >> env.sh
echo "export LD_LIBRARY_PATH=$ABS_PREFIX/lib:$ABS_PREFIX/lib64:\$LD_LIBRARY_PATH" >> env.sh
echo "export PATH=$ABS_PREFIX/bin:\$PATH" >> env.sh
echo "export OROCOS_TARGET=gnulinux" >> env.sh
echo "export VIZKIT_PLUGIN_RUBY_PATH=$ABS_PREFIX/lib" >> env.sh
source env.sh
else
echo "Please specify a prefix. If you want system wide installation use '/usr/local' as prefix."
exit -1
fi
build https://github.com/rock-core/base-cmake.git master base-cmake "$PREFIX"
build https://github.com/arneboe/base-types.git master base-types "-DBINDINGS_RUBY=OFF -DUSE_SISL=OFF -DROCK_VIZ_ENABLED=TRUE $PREFIX"
build https://github.com/rock-core/gui-osgviz.git master gui-osgviz "$PREFIX"
build https://github.com/orocos-toolchain/rtt.git master rtt "$PREFIX"
build https://github.com/rock-core/gui-vizkit3d.git master gui-vizkit3d "$PREFIX"