The installation of ccmake has been bothering me for a long time. And I finally get the concise way to solve this problem gracefully.
Introduction
When googling the solution to install ccmake, most of the answers will suggest you use sudo apt install cmake-curses-gui
, which is not actually a suitable method.
The reason is that the ccmake version installed from your Ubuntu package manager is tight to your cmake version corresponding to your operating system.
For example, if you use Ubuntu 18.04, the only version of cmake and ccmake you can get is 3.10*, which can be verified by apt policy cmake
or apt policy cmake-curses-gui
.
But when you need a higher version of ccmake, such as ccmake 3.22.1, just follow the steps below.
Steps to update ccmake
1. uninstall existing cmake version.
run
sudo make uninstall
in your source folder where you ran sudo make install
before.
You can get some details in this article:
2. Install the library you need
run
sudo apt install libncurses5-dev
Pay attention. Only if you get this library installed, can you successfully build a ccmake binary file in your bin directory of cmake.
And this is exactly the reason why you can’t get a ccmake version corresponding to your cmake version by default.
3. Rebuild cmake
Now, what you need to do is just repeat the build steps of cmake.
Take cmake 3.22.1 for example.
cd cmake-3.22.1
./bootstrap
make -j$(nproc)
sudo make install
Now, check the version and you’ll see something like this:
The ccmake has been automatically built into your bin directory of cmake source folder.
All configurations completed.