wsl ubuntu18.04 默认的cmake为3.10,编译CMakeLists.txt经常需要高版本cmake。
升级过程如下:
下载cmake-3.15.3-Linux-x86_64.tar.gz
wget https://cmake.org/files/v3.15/cmake-3.15.3-Linux-x86_64.tar.gz
解压文件
tar zxvf cmake-3.15.3-Linux-x86_64.tar.gz
查看解压文件
tree -L 2 cmake-3.15.3-Linux-x86_64
- tree -L 2 cmake-3.15.3-Linux-x86_64
- cmake-3.15.3-Linux-x86_64
- ├── bin
- │ ├── ccmake
- │ ├── cmake
- │ ├── cmake-gui
- │ ├── cpack
- │ └── ctest
- ├── doc
- │ └── cmake
- ├── man
- │ ├── man1
- │ └── man7
- └── share
- ├── aclocal
- ├── applications
- ├── cmake-3.15
- ├── icons
- └── mime
创建软链接
sudo mv cmake-3.15.3-Linux-x86_64 /opt/cmake-3.15.3
sudo ln -sf /opt/cmake-3.15.3/bin/* /usr/bin/
查看cmake版本
- cmake --version
- cmake version 3.15.3
-
- CMake suite maintained and supported by Kitware (kitware.com/cmake).