【介绍】
由于从MySQL5.5版本开始弃用了常规的configure编译方法,开始使用cmake编译工具。
【安装】
下载:https://cmake.org/download/
最新版本:cmake-3.18.1
wget https://cmake.org/files/v3.18/cmake-3.18.1.tar.gz && tar -zxvf cmake-3.18.1.tar.gz && cd cmake-3.18.1 && ./configure && make && make install
cmake安装耗时较长,输出:
... -- Installing: /usr/local/bin/cmake ... -- Installing: /usr/local/share/cmake-3.3/completions/ctest
查看版本:
cmake --version
输出:
cmake version 3.18.1 CMake suite maintained and supported by Kitware (kitware.com/cmake).
【排错】
如果报错:
CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been installed correctly.
参考:https://stackoverflow.com/questions/18615451/cmake-missing-modules-directory
执行以下命令清除缓存:
hash -r
编译安装完成。