2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
## File: cmake.sh
|
|
|
|
|
## Desc: Installs CMake
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
# Test to see if the software in question is already installed, if not install it
|
|
|
|
|
echo "Checking to see if the installer script has already been run"
|
|
|
|
|
if command -v cmake; then
|
2020-04-30 17:04:38 -07:00
|
|
|
echo "cmake is already installed"
|
2019-12-13 09:48:00 -05:00
|
|
|
else
|
2021-02-15 19:18:13 +03:00
|
|
|
json=$(curl -s "https://api.github.com/repos/Kitware/CMake/releases")
|
2021-02-18 03:04:50 +09:00
|
|
|
latest_tag=$(echo $json | jq -r '.[] | select(.prerelease==false).tag_name' | sort --unique --version-sort | grep -v "rc" | tail -1)
|
|
|
|
|
sh_url=$(echo $json | jq -r ".[] | select(.tag_name==\"${latest_tag}\").assets[].browser_download_url | select(endswith(\"inux-x86_64.sh\"))")
|
2021-02-15 19:18:13 +03:00
|
|
|
curl -sL ${sh_url} -o cmakeinstall.sh \
|
2019-12-13 09:48:00 -05:00
|
|
|
&& chmod +x cmakeinstall.sh \
|
|
|
|
|
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
|
|
|
|
|
&& rm cmakeinstall.sh
|
|
|
|
|
fi
|
|
|
|
|
|
2020-12-23 10:25:52 +03:00
|
|
|
invoke_tests "Tools" "Cmake"
|