-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·42 lines (37 loc) · 1.6 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
#!/bin/sh
SOURCE_DIR=${PWD}
BUILD_DIR=${PWD}/build
INSTALL_DIR=${PWD}/bin
if [ ! -e ${BUILD_DIR} ]; then
echo "The build dir does not exist, therefore it will be created."
mkdir -p ${BUILD_DIR}
fi
if [ ! -e ${INSTALL_DIR} ]; then
echo "The install dir does not exist, therefore it will be created."
mkdir -p ${INSTALL_DIR}
fi
export CC=gcc
export CXX=g++
echo '*============================================================================*'
echo '+----------------------------------------------------------------------------+'
echo '| prepare |'
cd ${BUILD_DIR}
echo 'workinkg directory: '
pwd
echo '+----------------------------------------------------------------------------+'
echo '| configure |'
echo cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ${SOURCE_DIR} || { echo "Configure failed." ; exit 5; }
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ${SOURCE_DIR} || { echo "Configure failed." ; exit 5; }
echo ''
echo '+----------------------------------------------------------------------------+'
echo '| make |'
make -j1 || { echo "Build failed"; exit 6; }
echo ''
echo '+----------------------------------------------------------------------------+'
echo '| make install |'
make -j1 install || { echo "Install failed"; exit 7; }
echo '*============================================================================*'
echo ''
echo ''
echo ''
echo ''