码迷,mamicode.com
首页 > 其他好文 > 详细

从源码安装cmake

时间:2019-05-11 19:50:07      阅读:544      评论:0      收藏:0      [点我收藏+]

标签:cmake   ima   完成后   add   sans   rom   warning   14.   problem   

##安装环境:ubuntu16.04

## 安装cmake之前需要确认已经安装make、gcc、g++,用make -v | gcc -v | g++ -v可查看是否已经安装,如果没有安装用apt-get安装一下(也可从源码安装)

sudo apt-get install gcc

sudo apt-get install g++

sudo apt-get install make

## cmake下载:https://cmake.org/download/

wget https://github.com/Kitware/CMake/releases/download/v3.14.3/cmake-3.14.3.zip

wget https://github.com/Kitware/CMake/releases/download/v3.14.3/cmake-3.14.3.tar.gz

注:

源码安装cmake-3.14-3的时候碰到了一些无法解决的错误,贴到了随笔最后,有解决的伙伴可以给个方法

下面直接安装cmake-3.13.4

##cmake解压: tar -zxvf cmake-3.13.4.tar.gz

技术图片

##cmake安装

step1:./bootstrap

step2:make

step3:make install

step4:cmake --version

如下安装成功:

 技术图片

 step5<可选>: make uninstall

 

##问题记录

1 cmake-3.14.3.zip解压完成后,cd cmake-3.14.3; chmod 775 ./configure; ./configure报错如下:

./configure: 3: exec: /home/guang/3rdTools/cmake-3.14.3/bootstrap: Permission denied

技术图片

解决:需要首先执行bootstrap(没有进一步研究为什么,网络上给的答案)

chmod 775 bootstrap

./bootstrap

技术图片

执行./bootstrap报错,还未找到答案

[18:09:54]In file included from /home/guang/3rdTools/cmake-3.14.3/Source/cmExportFileGenerator.h:11:0,
[18:09:54] from /home/guang/3rdTools/cmake-3.14.3/Source/cmExportTryCompileFileGenerator.h:8,
[18:09:54] from /home/guang/3rdTools/cmake-3.14.3/Source/cmCoreTryCompile.cxx:13:
[18:09:54]/home/guang/3rdTools/cmake-3.14.3/Bootstrap.cmk/cmVersionConfig.h:4:23: warning: missing terminating " character
[18:09:54]"34efine CMake_VERSION "3
[18:09:54] ^
[18:09:54]/home/guang/3rdTools/cmake-3.14.3/Bootstrap.cmk/cmVersionConfig.h:7:1: warning: missing terminating " character
[18:09:54]/home/guang/3rdTools/cmake-3.14.3/Bootstrap.cmk/cmVersionConfig.h:7:1: error: missing terminating " character
[18:09:55]/home/guang/3rdTools/cmake-3.14.3/Bootstrap.cmk/cmVersionConfig.h:5:1: error: expected unqualified-id before numeric constant
[18:09:55]Makefile:56: recipe for target ‘cmCoreTryCompile.o‘ failed
[18:09:55]make: *** [cmCoreTryCompile.o] Error 1
[18:09:55]---------------------------------------------
[18:09:55]Error when bootstrapping CMake:
[18:09:55]Problem while running make
[18:09:55]---------------------------------------------
[18:09:55]Log of errors: /home/guang/3rdTools/cmake-3.14.3/Bootstrap.cmk/cmake_bootstrap.log
[18:09:55]---------------------------------------------

从源码安装cmake

标签:cmake   ima   完成后   add   sans   rom   warning   14.   problem   

原文地址:https://www.cnblogs.com/leeguang/p/10849584.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!