1. 程式人生 > >Ubuntu16.04下安裝最新版本的CMake

Ubuntu16.04下安裝最新版本的CMake

當前最新版CMake為3.9.1.. Ubuntu中更新cmake到最新版本,過程如下:

1. 解除安裝已經安裝的舊版的CMake[非必需]

apt-get autoremove cmake

2. 檔案下載解壓:

wget https://cmake.org/files/v3.9/cmake-3.9.1-Linux-x86_64.tar.gz

解壓:

tar zxvf cmake-3.9.1-Linux-x86_64.tar.gz

檢視解壓後目錄:

tree -L 2 cmake-3.9.1-Linux-x86_64
cmake-3.9.1-Linux-x86_64
├── bin
│   ├── ccmake
│   ├── cmake
│   ├── cmake-gui
│ ├── cpack │ └── ctest ├── doc │ └── cmake ├── man │ ├── man1 │ └── man7 └── share ├── aclocal ├── applications ├── cmake-3.9 ├── icons └── mime 12 directories, 5 files

bin下面有各種cmake家族的產品程式.

3. 建立軟連結

注: 檔案路徑是可以指定的, 一般選擇在/opt/usr 路徑下, 這裡選擇/opt

mv cmake-3.9.1-Linux
-x86_64 /opt/cmake-3.9.1 ln -sf /opt/cmake-3.9.1/bin/* /usr/bin/

然後執行命令檢查一下:

>>>cmake --version
cmake version 3.9.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
>>>
>>>cmake-gui

OK。現在cmake最新版本安裝成功。
cmake圖形化介面

相關推薦

no