MAC下cmake安裝


可以參考網上手動下載cmake的源碼包進行安裝,http://www.cmake.org/download/

解壓后運行sudo ./bootstrap && sudo make && sudo make install

但是在執行./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神器。

安裝brew只需要一條命令即可:

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

這就成了,brew就用下面3條命令即可:

搜索軟件:brew search 軟件名,如brew search wget

安裝軟件:brew install 軟件名,如brew install wget

卸載軟件:brew remove 軟件名,如brew remove wget

 

bogon:wabase iwaimai$ brew search cmake
==> Searching local taps...
cmake
==> Searching taps on GitHub...
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%
==> 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
🍺 /usr/local/Cellar/cmake/3.10.2: 2,334 files, 32.4MB

這就算是安裝好了cmake了

 

參考:http://www.cnblogs.com/lzrabbit/p/4032515.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM