2017-02-03 00:00:46 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-12-07 11:01:14 +00:00
|
|
|
set -e
|
2017-02-03 00:00:46 +00:00
|
|
|
|
2018-12-07 11:01:14 +00:00
|
|
|
ROOTDIR="$(dirname "$0")/.."
|
|
|
|
BUILDDIR="${ROOTDIR}/build"
|
|
|
|
|
|
|
|
if [[ $# -eq 0 ]]; then
|
2017-02-03 00:00:46 +00:00
|
|
|
BUILD_TYPE=Release
|
2017-02-08 20:47:24 +00:00
|
|
|
else
|
2017-02-03 00:00:46 +00:00
|
|
|
BUILD_TYPE="$1"
|
|
|
|
fi
|
|
|
|
|
2017-12-06 14:14:54 +00:00
|
|
|
if [[ "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]; then
|
2018-12-07 11:01:14 +00:00
|
|
|
touch "${ROOTDIR}/prerelease.txt"
|
2017-12-06 14:14:54 +00:00
|
|
|
fi
|
|
|
|
|
2018-12-07 11:01:14 +00:00
|
|
|
mkdir -p "${BUILDDIR}"
|
|
|
|
cd "${BUILDDIR}"
|
2017-02-03 00:00:46 +00:00
|
|
|
|
2018-12-07 11:01:14 +00:00
|
|
|
cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}"
|
|
|
|
make -j2
|
2017-02-08 20:47:24 +00:00
|
|
|
|
2018-12-07 11:01:14 +00:00
|
|
|
if [[ "${CI}" == "" ]]; then
|
|
|
|
echo "Installing ..."
|
|
|
|
sudo make install
|
2017-12-06 08:58:24 +00:00
|
|
|
fi
|