diff --git a/.gitignore b/.gitignore index c9fbc5d..399053f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.user build-* +FlashMQBuild* diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..bfb9913 --- /dev/null +++ b/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +thisfile=$(readlink --canonicalize "$0") +thisdir=$(dirname "$thisfile") + +BUILD_TYPE="Release" +if [[ "$1" == "Debug" ]]; then + BUILD_TYPE="Debug" +fi + +BUILD_DIR="FlashMQBuild$BUILD_TYPE" + +if [[ -e "$BUILD_DIR" ]]; then + echo "$BUILD_DIR already exists. Not doing anything. You can run 'make' in it, if you want." + exit 1 +fi + +set -e +set -u + +mkdir "$BUILD_DIR" +cd "$BUILD_DIR" + +cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "$thisdir" +make