-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·57 lines (43 loc) · 1.15 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
BUILD_TYPE=$1
if [ -z "$BUILD_TYPE" ]
then
BUILD_TYPE=Release
fi
if [ -z "$CC" ]
then
CC=gcc
echo "Setting the compiler to $CC"
fi
if [ -z "$CXX" ]
then
CXX=g++
echo "Setting the compiler to $CXX"
fi
CMakeGenerator="Unix Makefiles"
src_dir=$(pwd)
build_dir=${src_dir}/cmake-build-${BUILD_TYPE}
install_dir=${src_dir}/install
mkdir "${build_dir}"
mkdir "${build_dir}/external"
check_status_code() {
if [ $1 -ne 0 ]
then
echo "[VIZ3D] Failure. Exiting."
exit 1
fi
}
cd "${build_dir}/external"
check_status_code $?
echo "[VIZ3D] -- Generating External Dependencies";
cmake -G "${CMakeGenerator}" -S ${src_dir}/external -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DINSTALL_ROOT=${install_dir} -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX
check_status_code $?
echo "[VIZ3D] -- Building External Dependencies"
cmake --build . --config Release
check_status_code $?
echo "[VIZ3D] -- Generating CMake File"
cd ${build_dir}
cmake -G "${CMakeGenerator}" -S ${src_dir} -DINSTALL_ROOT=${install_dir} -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
check_status_code $?
echo "[VIZ3D] -- Building Main Project"
cmake --build . --config Release --target install
check_status_code $?