在cmake編譯階段失敗,錯誤如下:
[WARNING] CMake Error at CMakeLists.txt:23 (cmake_minimum_required): [WARNING] CMake 3.1 or higher is required. You are running version 2.8.12.2
需要升級 CMake !
那么,我們先卸載已有的cmake
yum remove cmake
直接下載二進制文件包,安裝
cd /usr/tmp wget https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz tar zxvf cmake-3.10.2-Linux-x86_64.tar.gz cd cmake-3.10.2-Linux-x86_64
當前最新為 v3.19.2, 我沒有使用最新版.
二進制文件包,安裝,需要這樣安裝
你可以直接建立一個文件執行 以下命令, 也可以直接執行
vim install
輸入待執行命令
#!/bin/bash cp -r bin/* /usr/bin/ cp -r doc/* /usr/doc/ cp -r man/* /usr/local/man/ cp -r share/* /usr/share/
然后,執行
sh install
測試
[root@wsvr cmake-3.10.2-Linux-x86_64]# make -version GNU Make 3.82 Built for x86_64-redhat-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
OK, 安裝好了,收工.