tqcq
7d7845acb5
Some checks failed
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-arm (Debug) (push) Waiting to run
linux-arm-gcc / linux-gcc-arm (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Release) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Waiting to run
linux-x64-clang / linux-clang (Debug) (push) Waiting to run
linux-x64-clang / linux-clang (Release) (push) Waiting to run
linux-x64-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x64-gcc / linux-gcc (Release) (push) Waiting to run
linux-x86-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x86-gcc / linux-gcc (Release) (push) Waiting to run
android / build (push) Failing after 7m1s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Has been cancelled
35 lines
946 B
Bash
Executable File
35 lines
946 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
IFS=. read cm_maj cm_min cm_rel <<<"$1"
|
|
: ${cm_rel:-0}
|
|
CMAKE_ROOT=${2:-"${HOME}/cmake"}
|
|
|
|
function cmake_version ()
|
|
{
|
|
if [[ -d ${CMAKE_ROOT} ]] ; then
|
|
local perms=$(test $(uname) = "Linux" && echo "/111" || echo "+111")
|
|
local installed=$(find ${CMAKE_ROOT} -perm ${perms} -type f -name cmake)
|
|
if [[ "${installed}" != "" ]] ; then
|
|
echo "$(${installed} --version | head -1)"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
installed=$(cmake_version)
|
|
if [[ "${installed}" != "" && ${installed} =~ ${cm_maj}.${cm_min}.${cm_rel} ]] ; then
|
|
echo "cmake already installed: ${installed}"
|
|
exit
|
|
fi
|
|
|
|
pkgname="cmake-${cm_maj}.${cm_min}.${cm_rel}-$(uname)-x86_64.tar.gz"
|
|
tmppkg="/tmp/cmake.tar.gz"
|
|
wget --quiet https://cmake.org/files/v${cm_maj}.${cm_min}/${pkgname} -O ${tmppkg}
|
|
mkdir -p ${CMAKE_ROOT}
|
|
cd ${CMAKE_ROOT}
|
|
tar --strip-components 1 -xf ${tmppkg}
|
|
rm -f ${tmppkg}
|
|
echo "installed: $(cmake_version)"
|
|
|
|
|