-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·36 lines (31 loc) · 1011 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
#!/usr/bin/env bash
# Author : Gregory DEPUILLE
# Description : Wrapper pour la configuration et le build du projet
PROJECT="ARIG C++ RPLidar Bridge"
echo "Build du projet ${PROJECT}"
ROOT_DIR=$(pwd)
if [ "${#}" -eq 1 ] ; then
BUILD_NAME="${1}"
else
echo "Le nombre d'argument doit etre definie (local, odin ou nerell)"
exit 1
fi
if [ "${BUILD_NAME}" != "local" ] && [ "${BUILD_NAME}" != "odin" ] && [ "${BUILD_NAME}" != "nerell" ] ; then
echo "Le build name doit être local, odin ou nerell"
exit 2
fi
BUILD_DIR=${ROOT_DIR}/build-${BUILD_NAME}
cd "${ROOT_DIR}" || exit 1
if [ -d "${BUILD_DIR}" ] ; then
echo "-- Nettoyage du répertoire de build ${BUILD_DIR}"
rm -Rf "${BUILD_DIR}"
fi
echo "-- Création du répertoire de build ${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
echo "-- Build directory : ${BUILD_DIR}"
sh download.sh
echo "-- Build du projet ${PROJECT}"
cd "${BUILD_DIR}" || exit 1
cmake .. -DBUILD_NAME="${BUILD_NAME}" || exit ${?}
cmake --build . || exit $?
echo "Build terminé"