美文网首页
linux下安装cmake

linux下安装cmake

作者: 东京的雨不会淋湿首尔 | 来源:发表于2017-11-22 21:12 被阅读1755次

1.在官网下载对应版本的包
https://cmake.org/download/
注意32位和64 位一定要区分开

2.如果是下载的含有source标签的则是源代码文件,需要自己编译,如果下载的是Binary distributions对应的则是已经编译好的版本,只需要添加环境变量就行。

3.一下以安装源文件版本为例
下载源文件后解压,进入文件目录

sudo ./bootstrap

遇到

---------------------------------------------
CMake 3.10.0, Copyright 2000-2017 Kitware, Inc. and Contributors
C compiler on this system is: cc  
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler supporting C++11 on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /home/javascript/下载/cmake-3.10.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

原来是没有装c++的编译器

ubuntu: apt-get install gcc g++
CentOS:yum install gcc gcc-c++

4.再次执行sudo ./bootstrap,成功结果如下

---------------------------------------------
CMake has bootstrapped.  Now run make.

5.执行

sudo make

编译完成部分结果如下:

[ 99%] Linking C executable pseudo_tidy
[ 99%] Built target pseudo_tidy
Scanning dependencies of target pseudo_cppcheck
[ 99%] Building C object Tests/RunCMake/CMakeFiles/pseudo_cppcheck.dir/pseudo_cppcheck.c.o
[ 99%] Linking C executable pseudo_cppcheck
[ 99%] Built target pseudo_cppcheck
Scanning dependencies of target foo
[100%] Building CXX object Tests/FindPackageModeMakefileTest/CMakeFiles/foo.dir/foo.cpp.o
[100%] Linking CXX static library libfoo.a
[100%] Built target foo

6.执行

sudo make install

执行完成之后输入

cmake --version

查看版本和下载的是否一致,我下载的3.10.0

cmake --version
cmake version 3.10.0

安装完成

相关文章

  • CMake学习

    目录 什么是CMake? linux平台安装CMake CMake的helloworld 1. 什么是CMake?...

  • linux下安装cmake

    1.在官网下载对应版本的包https://cmake.org/download/注意32位和64 位一定要区分开 ...

  • Linux下cmake安装

    1. cmake安装 1.1 yum 安装 卸载 1.2 apt-get 安装 卸载 1.3 源码安装

  • 2022年CMAKE笔记

    安装CMAKE 1.Centos Linux可使用yum安装CMake。 2.源代码安装 3.Window没用安装...

  • windows 动态库dll进行linux编译过程记录

    工具及环境 编译环境:windows 子linux系统(WSL)工具:cmake cmake安装及使用 cmake...

  • Linux 安装 Cmake

    下载安装文件 增加环境变量,使其成为全局变量: 在文件末尾处增加以下代码 注意:写自己刚安装cmake的bin的路...

  • Linux安装CMake

    Linux下安装CMake,安装的方式一共有三种: 包管理工具 二进制包安装 源码手动编译安装 包管理工具 直接通...

  • Ubuntu安装cmake3.5

    参考在CentOS安装CMake 升级cmake 3.5Ubuntu下安装cmake 我按照这一篇来不行,应该是装...

  • OGRE——编译ogre源码总结

    需要安装的软件 cmake hg(linux上面执行:sudo apt-get install mercurial...

  • LNMP安装教程:安装mysql

    安装Mysql前需要安装cmake 1.安装cmake 下载cmake wget http://www.cmake...

网友评论

      本文标题:linux下安装cmake

      本文链接:https://www.haomeiwen.com/subject/hvgovxtx.html