From 9667c4b3239bc47efa42fdc36cd464a1ed092f90 Mon Sep 17 00:00:00 2001 From: Eisen Montalvo Date: Fri, 4 Jun 2021 19:12:11 -0700 Subject: [PATCH] Check if CMake is installed. If not, abort the build script and display error message. --- BuildMacOS.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BuildMacOS.sh b/BuildMacOS.sh index 38f333e96..7c7da1b72 100755 --- a/BuildMacOS.sh +++ b/BuildMacOS.sh @@ -2,6 +2,14 @@ export ROOT=`pwd` export NCORES=`sysctl -n hw.ncpu` +export CMAKE_INSTALLED=`which cmake` + +# Check if CMake is installed +if [[ -z "$CMAKE_INSTALLED" ]] +then + echo "Can't find CMake. Either is not installed or not in the PATH. Aborting!" + exit -1 +fi while getopts ":ih" opt; do case ${opt} in