安装流程
cmake官网下载最新的cmake
https://cmake.org/download/
我们选择下载cmake-3.13.4并解压,并进入到cmake-3.13.4目录下,依次执行下面命令。
sudo ./bootstrap
编译:
sudo make -j 8
后面的8为计算机cpu核心数
编译成功后安装:
sudo make install #安装
安装完毕之后,进行测试:
cmake --version
安装cmake-gui
sudo apt-get install cmake-qt-gui
安装cmake提示错误:
1,提示找不到c编译器
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.
安装g++:sudo apt-get install g++,若不行,安装qt等编译器
2,提示找不到openssl,但是查询openssl是有的
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
CMake Error at Utilities/cmcurl/CMakeLists.txt:511 (message):
Could not find OpenSSL. Install an OpenSSL development package or
configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
解决方法:sudo apt-get install libssl-dev