diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -8,6 +8,15 @@ BUILDDIR="build" DIR=$(pwd) +SCRIPTNAME=$(basename "$0" 2>/dev/null || echo "$0") + +if [[ ! -f "$DIR"/"$SRCDIR"/CMakeLists.txt ]] +then + echo "$SRCDIR/CMakeLists.txt not found" >&2 + echo "please run '$SCRIPTNAME' from its containing directory" >&2 + exit 1 +fi + for OPTION in "$@" do if [[ "$OPTION" == "--clean" ]] @@ -22,14 +31,6 @@ do fi done -if [[ ! -f "$DIR"/"$SRCDIR"/CMakeLists.txt ]] -then - echo "$SRCDIR/CMakeLists.txt not found" >&2 - SCRIPTNAME=$(basename "$0" 2>/dev/null || echo "$0") - echo "please run '$SCRIPTNAME' from its containing directory" >&2 - exit 1 -fi - # note: NCORES may be too large on systems with hyperthreading NCORES=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null) if [[ ! $NCORES -ge 1 ]] |