can refer to the online manual download CMake source package for installation, http://www.cmake.org/download/
Run sudo after decompression./bootstrap && sudo make && sudo make install
However, when executing./bootstrap, the following error is reported:
/users/baidu/cmake-3.9.0/source/cmsystemtools.cxx:2061:39:error:expected '; ' After expressionexe_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 error S 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---------------------------------------------
Looking for a long time on the internet did not find a solution, then decided to use brew to install. What's a brew? is actually the Linux system under the Apt-get, Yum artifact.
Installing brew requires only one command:
" $ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install) "
This is the only way to brew the following 3 commands:
Search Software: Brew search software name, such as Brew search wget
Install software: Brew install software name, such as Brew install wget
Uninstall software: Brew remove software name, such as 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%
==> Pouring cmake-3.10.2.high_sierra.bottle.tar.gz
==> Caveats
Emacs Lisp files has been installed to:
/usr/local/share/emacs/site-lisp/cmake
==> Summary
?? /usr/local/cellar/cmake/3.10.2:2,334 files, 32.4MB
Well, that's the installation of CMake.
Reference: http://www.cnblogs.com/lzrabbit/p/4032515.html
CMake installation under Mac