1. 程式人生 > 實用技巧 >CentOS7升級cmake

CentOS7升級cmake

在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

二進位制檔案包,安裝,需要這樣安裝

你可以直接建立一個 檔案執行 以下命令, 也可以直接執行

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, 安裝好了,收工.