Ubuntu通过资源包安装CMake

2021-12-07  本文已影响0人  Lyudmilalala

项目要用的cmake库需要3.21以上,apt-get install安装的cmake到不了这么高版本,只能从资源包安装

官网下载资源包地址: https://cmake.org/download/

下载安装包

wget https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0.tar.gz

解压

tar -zxv -f cmake-3.22.0.tar.gz

进入资源包并build

cd cmake-3.22
./bootstrap
make
make install

可以通过以下命令查看安装版本

cmake --version

Bug #1

---------------------------------------------
CMake 3.22.0, Copyright 2000-2021 Kitware, Inc. and Contributors
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.

---------------------------------------------
Log of errors: /opt/cmake-install/cmake-3.22.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

需要安装c++编译工具

apt-get install gcc g++   # ubuntu
yum install gcc gcc-c++   # centos

Bug #2

---------------------------------------------
CMake 3.22.0, Copyright 2000-2021 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc   
C++ compiler on this system is: g++    
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE.
---------------------------------------------
Log of errors: /opt/cmake-install/cmake-3.22.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

需要安装make工具

apt-get install make   # ubuntu
yum install make   # centos
上一篇 下一篇

猜你喜欢

热点阅读