-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·42 lines (35 loc) · 890 Bytes
/
build.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/bash
#
# Copyright © 2021 Maxim Morozov. All rights reserved.
#
# Created by Maxim Morozov on 31/03/2021.
#
# bijective-numeration
#
# build.sh
#
APPLICATION_HOME="$(pwd)"
APPLICATION_BUILD="${APPLICATION_HOME}/build"
rm -rf "${APPLICATION_BUILD}"
mkdir -p "${APPLICATION_BUILD}"
pushd "${APPLICATION_BUILD}" >/dev/null
# CMake supports the build types: Debug, Release, MinSizeRel, RelWithDebInfo.
cmake -DCMAKE_BUILD_TYPE=Release "${APPLICATION_HOME}"
EXIT_CODE=$?
if [[ "$EXIT_CODE" -ne 0 ]]; then
echo "ERROR: CMake failed with exit code $EXIT_CODE"
exit "$EXIT_CODE"
fi
make
EXIT_CODE=$?
if [[ "$EXIT_CODE" -ne 0 ]]; then
echo "ERROR: Make failed with exit code $EXIT_CODE"
exit "$EXIT_CODE"
fi
make install
EXIT_CODE=$?
if [[ "$EXIT_CODE" -ne 0 ]]; then
echo "ERROR: Install failed with exit code $EXIT_CODE"
exit "$EXIT_CODE"
fi
popd >/dev/null