1 Star 0 Fork 0

yll1024335892 / shell_script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cmake3.sh 1002 Bytes
一键复制 编辑 原始数据 按行查看 历史
yll1024335892 提交于 2022-08-14 10:32 . ok
#/bin/bash
RESOURCE="/home/tools"
VERSION="cmake-3.6.2"
DOWNLOADURL="https://cmake.org/files/v3.6/${VERSION}.tar.gz"
# 检测wget工具是否安装
rpm -q wget &>/dev/null
if [ $? -ne 0 ]; then
yum install wget -y
fi
rpm -q gcc &>/dev/null
if [ $? -ne 0 ]; then
yum install gcc -y
fi
rpm -q gcc-c++ &>/dev/null
if [ $? -ne 0 ]; then
yum install gcc-c++ -y
fi
# 创建目标文件家
if [ ! -d "${RESOURCE}" ]; then
mkdir -p ${RESOURCE}
fi
function buildCMake() {
if [ ! -d "${RESOURCE}/${VERSION}" ]; then
cd ${RESOURCE}
tar -zxvf ${VERSION}.tar.gz
fi
cd "${RESOURCE}/${VERSION}"
./bootstrap
gmake && gmake install
if [ $? -eq 0 ]; then
ln -sf /usr/local/bin/cmake /usr/bin/cmake3
cmake3 --version
echo "cmake安装成功"
else
echo "cmake安装失败"
exit 1
fi
}
if [ ! -f "${RESOURCE}/${VERSION}.tar.gz" ]; then
cd ${RESOURCE}
wget ${DOWNLOADURL}
buildCMake
else
buildCMake
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/1024335892/shell_script.git
git@gitee.com:1024335892/shell_script.git
1024335892
shell_script
shell_script
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891