linux安装cmake
参考: linux安装cmake
建议手动编译安装,方便卸载
下载cmake源码, Unix/Linux Source (has \n line feeds)
压缩包放在自己方便管理的任何文件夹都可以
step1: 解压
tar -zxvf cmake-3.17.0-rc2.tar.gz
cd cmake-3.17.0-rc2
step2:
./bootstrap
可能遇到的问题:
(1)Error when bootstrapping CMake:
Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE.
解决办法:
sudo apt-get install build-essential
(2)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:525 (message):
Could not find OpenSSL. Install an OpenSSL development package or
configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
解决办法:
sudo apt install libssl-dev
step3:
make -j 4
sudo make install
step4:
测试
cmake -version
想要卸载,可以
make uninstall
或者找到 cmake-3.17.0-rc2/install_manifest.txt
使用命令删除:
xargs rm < install_manifest.txt