標籤:
本人在安裝mysql的時候,需要安裝cmake.
但是在安裝的時候需要很多細節,那麼這裡來說明一下。
軟體:cmake-2.8.5.tar.gz
wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
[[email protected] /]# yum install gcc-c++
[[email protected] /]# yum install ncurses-devel
安裝cmake
將cmake-2.8.10.2.tar.gz檔案上傳到/usr/local中執行以下操作:
[[email protected] local]# cd /usr/local
[[email protected] local]# tar -zxv -f cmake-2.8.5.tar.gz // 解壓壓縮包
[[email protected] local]# rm -rf cmake-2.8.5.tar.gz // 刪除壓縮包
[[email protected] local]# cd cmake-2.8.5
[[email protected] cmake-2.8.5]# ./configure
[[email protected] cmake-2.8.5]# make
[[email protected] cmake-2.8.5]# make install
[[email protected] local]# mv cmake-2.8.5 cmake // 修改檔案夾名
添加環境變數
用vi在檔案/etc/profile檔案中增加變數,使其永久有效:
[[email protected] local]# vi /etc/profile // 修改環境變數
在檔案末尾追加以下兩行代碼:
PATH=/usr/local/cmake/bin:$PATH
export PATH
然後執行以下操作:
[[email protected] local]# source /etc/profile //使修改生效
[[email protected] local]# echo $PATH //查看PATH值
檢驗cmake安裝
[[email protected] local]# cmake --version
歐克,這就應該可以了。
centos下安裝cmake