cmake.sh 986 Bytes
Newer Older
1
2
3
4
#!/bin/sh

set -e

Ben Boeckel's avatar
Ben Boeckel committed
5
readonly version="3.19.4"
6
7
8
9

case "$( uname -s )" in
    Linux)
        shatool="sha256sum"
Ben Boeckel's avatar
Ben Boeckel committed
10
        sha256sum="ff23e1f53c53e8ef1fa87568345031d86c504e53efb52fa487db0b8e0ee4d3ff"
11
        platform="Linux"
Ben Boeckel's avatar
Ben Boeckel committed
12
        arch="x86_64"
13
14
15
        ;;
    Darwin)
        shatool="shasum -a 256"
Ben Boeckel's avatar
Ben Boeckel committed
16
17
18
        sha256sum="eb1f52996632c1e71a1051c9e2c30cc8df869fb5a213b1a0d3b202744c6c5758"
        platform="macos"
        arch="universal"
19
20
21
22
23
24
25
26
27
        ;;
    *)
        echo "Unrecognized platform $( uname -s )"
        exit 1
        ;;
esac
readonly shatool
readonly sha256sum
readonly platform
Ben Boeckel's avatar
Ben Boeckel committed
28
readonly arch
29

Ben Boeckel's avatar
Ben Boeckel committed
30
readonly filename="cmake-$version-$platform-$arch"
31
32
33
34
35
36
readonly tarball="$filename.tar.gz"

cd .gitlab

echo "$sha256sum  $tarball" > cmake.sha256sum
curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball"
37
$shatool --check cmake.sha256sum
38
39
tar xf "$tarball"
mv "$filename" cmake
40
41
42
43

if [ "$( uname -s )" = "Darwin" ]; then
    ln -s CMake.app/Contents/bin cmake/bin
fi