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).
相关推荐
光头闪亮亮19 分钟前
C++凡人修仙法典 - 宗门版-上
c++
光头闪亮亮22 分钟前
C++凡人修仙法典 - 宗门版-下
c++
John_ToDebug1 小时前
Chromium base 库中的 Observer 模式实现:ObserverList 与 ObserverListThreadSafe 深度解析
c++·chrome·性能优化
科大饭桶1 小时前
C++入门自学Day11-- String, Vector, List 复习
c语言·开发语言·数据结构·c++·容器
点云SLAM2 小时前
C++中内存池(Memory Pool)详解和完整示例
开发语言·c++·内存管理·内存池·new/delete·malloc/free
wow_DG2 小时前
【C++✨】多种 C++ 解法固定宽度右对齐输出(每个数占 8 列)
开发语言·c++·算法
Epiphany.5562 小时前
c++最长上升子序列长度
c++·算法·图论
颖川守一4 小时前
C++c6-类和对象-封装-设计案例2-点和圆的关系
开发语言·c++
charlee444 小时前
将std容器的正向迭代器转换成反向迭代器
c++
arbboter4 小时前
【C++20】新特性探秘:提升现代C++开发效率的利器
c++·c++20·新特性·span·结构化绑定·初始化变量·模板参数推导