Follow the step below to install CMake 3.0 on CentOS 7:
- Download cmake-3.0.0.tar.gz to a folder, e.g. /home/user/Downloads
- Open a terminal and run below commands:
tar -zxvf cmake-3.0.0.tar.gz
- In the terminal and run below commands:
sudo gmake install
It will take several minutes to build cmake out of source files.
But If you run the command below, you will see the cmake version is still the old 2.82 or earlier version!
- Now in the terminal, type below commands
sudo mv cmake-3.0.0 /usr/local/
This move the newly built output folder
- Edit ~/.bashrc file, add the directory /usr/local/cmake-3.0.0/bin to the PATH variable:
At the end of .bashrc file, add below line to add the cmake/bin folder to system path:
- Next, in the terminal, type below commands
cp -R /usr/local/share/cmake-3.0/ share/
This copies folder
If you don’t do so, errors will pop up and complain that the share folder is not accessible to centOS!
Now, rerun the below command and you will succeed!