标签:
前提条件:
系统要提前安装上gcc-c++和ncurses-devel,若没有安装,需要安装这两个软件包:
# yum list |grep gcc-c++ gcc-c++.x86_64 4.1.2-50.el5 rhel-source # yum list |grep ncurses-devel ncurses-devel.i386 5.5-24.20060715 installed ncurses-devel.x86_64 5.5-24.20060715 installed #
安装cmake:
# tar -xvf cmake-3.2.3.tar.gz # mv cmake-3.2.3 cmake # mv cmake /usr/local/ # cd /usr/local/cmake/ # ./bootstrap # make # make install
修改环境变量
在/etc/profile文件中增加变量,使其永久有效:
# vi /etc/profile
在文件末尾追加以下两行代码:
PATH=/usr/local/cmake/bin:$PATH
export PATH
然后执行以下操作使环境变量生效:
# source /etc/profile
查看PATH值:
# echo $PATH
检验安装成果:
# cmake --version cmake version 3.2.3 CMake suite maintained and supported by Kitware (kitware.com/cmake).
标签:
原文地址:http://www.cnblogs.com/abclife/p/4617181.html