diff options
Diffstat (limited to '.gitlab/ci/cmake.sh')
-rwxr-xr-x | .gitlab/ci/cmake.sh | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh index 4b2f53f..658a62a 100755 --- a/.gitlab/ci/cmake.sh +++ b/.gitlab/ci/cmake.sh @@ -3,14 +3,38 @@ set -e readonly version="3.17.2" -readonly sha256sum="dc57f3cc448ca67fc8776b4ad4c22b087b9c6a8e459938b9622b8c7f4ef6b21e" -readonly filename="cmake-$version-Linux-x86_64" + +case "$( uname -s )" in + Linux) + shatool="sha256sum" + sha256sum="dc57f3cc448ca67fc8776b4ad4c22b087b9c6a8e459938b9622b8c7f4ef6b21e" + platform="Linux" + ;; + Darwin) + shatool="shasum -a 256" + sha256sum="139500e20b080444fcafe57f24f57248c691c5187cce6695bee2b9aad6792c7d" + platform="Darwin" + ;; + *) + echo "Unrecognized platform $( uname -s )" + exit 1 + ;; +esac +readonly shatool +readonly sha256sum +readonly platform + +readonly filename="cmake-$version-$platform-x86_64" readonly tarball="$filename.tar.gz" cd .gitlab echo "$sha256sum $tarball" > cmake.sha256sum curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" -sha256sum --check cmake.sha256sum +$shatool --check cmake.sha256sum tar xf "$tarball" mv "$filename" cmake + +if [ "$( uname -s )" = "Darwin" ]; then + ln -s CMake.app/Contents/bin cmake/bin +fi |