#!/bin/sh set -e readonly version="3.24.0-rc1" case "$(uname -s)-$(uname -m)" in Linux-x86_64) shatool="sha256sum" sha256sum="183ff011a2177d0a683e81d645d02c0ed8ff790449158522928ef069775091cc" platform="linux-x86_64" ;; Linux-aarch64) shatool="sha256sum" sha256sum="f26642d5bc503de6bf7dd2d06afb8777d5862aa44e556cdf4155fec60e534d04" platform="linux-aarch64" ;; Darwin-*) shatool="shasum -a 256" sha256sum="417fde30f2cf96f53eaf27b1e510924ce441f0449e53974f2156cb19d32978b9" platform="macos-universal" ;; *) echo "Unrecognized platform $(uname -s)-$(uname -m)" exit 1 ;; esac readonly shatool readonly sha256sum readonly platform readonly filename="cmake-$version-$platform" readonly tarball="$filename.tar.gz" cd .gitlab echo "$sha256sum $tarball" > cmake.sha256sum curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" $shatool --check cmake.sha256sum tar xf "$tarball" mv "$filename" cmake if [ "$( uname -s )" = "Darwin" ]; then ln -s CMake.app/Contents/bin cmake/bin fi