Commit 5dce712d authored by James Clark's avatar James Clark

Smarter logic to determine cmake executable

parent 3ff91718
......@@ -3,22 +3,31 @@ set -e
INSTALL_PREFIX=$1
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
machine=Linux
# Get cmake
if hash cmake 2>/dev/null; then
CMAKE=cmake
# Check version >2
CMAKE_VERSION=$(${CMAKE} --version | head -1 | awk '{print $3}')
CMAKE_VERSION=( ${CMAKE_VERSION//./ } )
CMAKE_MAJOR_VERSION=${CMAKE_VERSION[0]}
if [ ${CMAKE_MAJOR_VERSION} -lt 3 ]; then
echo "cmake executable is version ${CMAKE_VERSION}, checking for cmake3 executable..."
if hash cmake3 2> /dev/null; then
CMAKE=cmake3
;;
Darwin*)
machine=Darwin
CMAKE=cmake
;;
*)
machine="UNKNOWN:${unameOut}"
echo "Unsupported hostOS: ${machine}"
else
echo "cmake3 not found"
exit 1
esac
echo "Host OS is ${machine}. Using $CMAKE"
fi
fi
elif hash cmake3 2>/dev/null; then
CMAKE=cmake3
else
echo "No cmake detected. BayesWave requires cmake version 3."
exit 1
fi
${CMAKE} --version
rm -rf build
mkdir -p build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment