1、安装cmake3.5.1或更新的版本
安装gcc-c++:sudo apt-get install build-essential (或者直接执行这两条命令sudo apt-get install gcc,sudo apt-get install g++)
wget https://cmake.org/files/v3.9/cmake-3.9.2.tar.gz
cd cmake-3.9.2
./configure
sudo make && make install
本人电脑上安装3.9.2版本出错,以下是安装3.9.6版本:
sudo chmod 777 * -R
cd cmake-3.9.6/
mkdir /usr/local/cmake/
./configure --prefix=/usr/local/cmake/ 或:./bootstrap --prefix=/usr/local/cmake/
make
sudo make install
cmake 卸载:
sudo apt-get remove cmake cmake-data
升级新版本:(目前升级后是3.2.2版本)
cmake
sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x(ppa 源中的版本修改)
sudo -E apt-get update
sudo apt-get install cmake
2、安装 opencv 4.0.0
$ mkdir build
$ cd build
$ cmake ..
$ sudo make -j4
$ sudo make install