当前位置:   article > 正文

Ubuntu 20.04安装CMake 3.22.6版本_ubuntu20.04 camke3.29.3

ubuntu20.04 camke3.29.3

Ubuntu 20.04通过apt安装的cmake版本是3.16.3,默认安装到/usr/bin/cmake路径。

  1. $ cmake
  2. Command 'cmake' not found, but can be installed with:
  3. sudo snap install cmake # version 3.29.3, or
  4. sudo apt install cmake # version 3.16.3-1ubuntu1.20.04.1
  5. See 'snap info cmake' for additional versions.

如果想安装其他版本,比如v3.22.6,可以到cmake的历史版本网页中下载。

Index of /files/v3.22icon-default.png?t=N7T8https://cmake.org/files/v3.22/下载路径:

https://cmake.org/files/v3.22/cmake-3.22.6-linux-x86_64.shicon-default.png?t=N7T8https://cmake.org/files/v3.22/cmake-3.22.6-linux-x86_64.sh

下面是在Ubuntu上的安装过程

  1. # 创建目录
  2. $ sudo mkdir /opt/cmake
  3. # 下载文件
  4. $ cd /opt/cmake
  5. $ sudo wget https://cmake.org/files/v3.22/cmake-3.22.6-linux-x86_64.sh
  6. $ sudo chmod +x cmake-3.22.6-linux-x86_64.sh
  7. # 安装程序,期间要回复确认
  8. $ sudo ./cmake-3.22.6-linux-x86_64.sh
  9. # 创建软连接
  10. $ cd /usr/bin
  11. $ sudo ln -s /opt/cmake/cmake-3.22.6-linux-x86_64/bin/cmake cmake

安装完成后,即可在任意路径执行cmake 

  1. ~$ cmake
  2. Usage
  3. cmake [options] <path-to-source>
  4. cmake [options] <path-to-existing-build>
  5. cmake [options] -S <path-to-source> -B <path-to-build>
  6. Specify a source directory to (re-)generate a build system for it in the
  7. current working directory. Specify an existing build directory to
  8. re-generate its build system.
  9. Run 'cmake --help' for more information.
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/830799
推荐阅读
相关标签
  

闽ICP备14008679号