linux cmake 使用,mac cmake 使用_linux cmake 使用_cmake 使用

9E3703967BF526377C155B3C25CF.jpg

可以参考网上手动下载cmake的源码包进行安装mac cmake 使用,

$ mkdir work && cd work $ sudo apt-get update $ sudo apt-get install python-dev $ sudo pip install numpy $ sudo apt-get install python-matplotlib $ sudo apt-get install python-pil。$ sudo apt-get install build-essential $ sudo apt-get install ncurses-dev $ sudo apt-get install xorg-dev $ sudo apt-get install libgtk2.0-dev。sudo make install 2>&1 | tee install.out #as a user with write permissions to the install tree。

但是在执行./bootstrap的时候报以下错误:

/Users/baidu/cmake-3.9.0/Source/cmSystemTools.cxx:2061:39: error: expected ‘;‘ after expression

exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";

^

;

/Users/baidu/cmake-3.9.0/Source/cmSystemTools.cxx:2061:13: error: use of undeclared identifier ‘CMAKE_BOOTSTRAP_BINARY_DIR‘

exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";

^

/Users/baidu/cmake-3.9.0/Source/cmSystemTools.cxx:2121:28: error: use of undeclared identifier ‘CMAKE_BOOTSTRAP_SOURCE_DIR‘

cmSystemToolsCMakeRoot = CMAKE_BOOTSTRAP_SOURCE_DIR;

^

/Users/baidu/cmake-3.9.0/Source/cmSystemTools.cxx:2061:40: warning: expression result unused [-Wunused-value]

exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";

^~~~~~

1 warning and 3 errors generated.

make: *** [cmSystemTools.o] Error 1

---------------------------------------------

Error when bootstrapping CMake:

Problem while running make

---------------------------------------------

Log of errors: /Users/baidu/cmake-3.9.0/Bootstrap.cmk/cmake_bootstrap.log

---------------------------------------------

在网上找了好久也没有找到解决办法,遂决定采用brew来安装了。brew是个什么东东呢?其实就是linux系统下面的apt-get、yum神器。

6fc902a33d4164a1ef3ceb4c2553c426.png

安装brew只需要一条命令即可:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

这就成了,brew就用下面3条命令即可:

搜索软件:brew search 软件名mac cmake 使用,如brew search wget

安装软件:brew install 软件名,如brew install wget

v2-6d15e49688b220910cf2e5d3ecc9eb07_b.jpg

卸载软件:brew remove 软件名,如brew remove wget

bogon:wabase iwaimai$ brew search cmake

==> Searching local taps...

cmake

==> Searching taps on GitHub...

68f5f0867f849817ba7247982e4c907f.png

caskroom/cask/cmake

==> Searching blacklisted, migrated and deleted formulae...

bogon:wabase iwaimai$ brew install cmake

==> Downloading https://homebrew.bintray.com/bottles/cmake-3.10.2.high_sierra.bottle.tar.gz

######################################################################## 100.0%

03144440_064e62d3b3.jpg

==> Pouring cmake-3.10.2.high_sierra.bottle.tar.gz

==> Caveats

Emacs Lisp files have been installed to:

/usr/local/share/emacs/site-lisp/cmake

==> Summary

cmake error at /usr/local/share/cmake-3.6/modules/findpkgconfig.cmake:424 (message):。cmake -d cmake_c_compiler=/usr/local/bin/gcc -d cmake_cxx_compiler=/usr/local/bin/g+。cmake -dlibmongoc_dir=/usr/local/ -dcmake_build_type=release -dbsoncxx_poly_use_boost=1 -dcmake_install_prefix=/usr/local ..。

这就算是安装好了cmake了

参考:

本文来自电脑杂谈,转载请注明本文网址:

http://www.pc-fly.com/a/ruanjian/article-116199-1.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值