CMake Error: Could not find CMAKE_ROOT !!!

It's need upgrade the cmake version to later than 3.11 because of project requirments. So download the latest cmake version(3.17)

1. Git clone the source code

git clone https://github.com/Kitware/CMake.git

2. Compile and Installation

Enter the cmake source path, type in the follows command, then waiting finished.

./bootstrap --prefix=/usr/local/ && make && sudo make install

3. CMake Version

cmake --version

I got the follows error:

CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/share/cmake-3.5
cmake version 3.5.1

Solution: Enter the CMake/bin, then rebuild the symbol link

sudo ln -sf ./cmake /usr/bin/cmake

猜你喜欢

转载自blog.csdn.net/jiaken2660/article/details/105151156