ubuntu18安装cmake27的方法

背景是ubuntu18默认的cmake是3.10

bash 复制代码
$ apt search cmake 

Sorting... Done
Full Text Search... Done
bear/bionic,bionic 2.3.11-1 all
  generate compilation database for Clang tooling

catkin/bionic,bionic 0.7.8-1 all
  Low-level build system macros and infrastructure for Robot OS

cmake/bionic-updates,now 3.10.2-1ubuntu2.18.04.2 amd64 [installed]
  cross-platform, open-source make system

3.10 没有 target_link_directories 所以我想升级到3.27版本。

升级方法

step 1 从官网下载Binary distributions

https://cmake.org/download/
https://github.com/Kitware/CMake/releases/download/v3.27.4/cmake-3.27.4-linux-x86_64.tar.gz

step 2

bash 复制代码
tar -zxvf cmake-3.27.4-linux-x86_64.tar.gz
mv cmake-3.27.4-linux-x86_64 /usr/local
export PATH=/usr/local/cmake-3.27.4-linux-x86_64/bin:$PATH

step 3

bash 复制代码
$ cmake --version
cmake version 3.27.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
相关推荐
☆cwlulu28 分钟前
try-throw-catch异常捕获流程
开发语言·c++
王老师青少年编程1 小时前
2026年6月GESP真题及题解(C++五级):排排坐
c++·题解·真题·gesp·五级·2026年6月·排排坐
郝学胜-神的一滴1 小时前
Qt 高级编程 034:深耕QWidget底层内核—彻底吃透无边框窗口设计核心原理
开发语言·c++·qt·程序人生·软件开发·用户界面
不会写代码的ys1 小时前
C++复习篇
java·开发语言·c++
aichitang20242 小时前
数论变换(NTT)
c++·算法·fft·ntt
_olone2 小时前
AtCoder Beginner Contest 465 D - X to Y
c++·算法
星夜夏空992 小时前
C++学习(3) —— C++输入输出流
c++·学习
CAU界编程小白2 小时前
CAU抢课脚本
c++·脚本
MOONICK2 小时前
windows原生条件变量支持
c++·windows
汉克老师3 小时前
GESP2026年6月认证C++二级( 第三部分编程题(1、完全平方数计数))精讲
c++·循环·枚举算法·gesp2级·平方数·逆向枚举·区间判断