diff --git a/rebuildall.sh b/rebuildall.sh new file mode 100755 index 0000000..d12da51 --- /dev/null +++ b/rebuildall.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +function cd { + if (("$#" > 0)); then + if [ "$1" == "-" ]; then + popd &> /dev/null + return $? + else + pushd "$@" &> /dev/null + return $? + fi + else + cd $HOME + return $? + fi +} + +for z in Debug Release Final +do + cd $z + retCode=$? + if [ $retCode != 0 ]; then + mkdir $z && cd $z + retCode=$? + fi + + if [ $retCode == 0 ]; then + rm -rf * + cmake ../../ -DCMAKE_BUILD_TYPE=$z + make -j2 + cd .. + fi +done