Cmake is a versatile tool that is widely used in the Linux operating system to manage the build process of software projects. It enables developers to specify the desired build configurations in a platform- and compiler-independent manner, making it easy to build and maintain software on a wide range of systems.
It uses a simple, declarative language to describe the build process, and it generates native build scripts for the selected platform and compiler. This allows developers to focus on the code, rather than worrying about the intricacies of the build system.
CMake also supports a wide range of common build tasks, such as building executables, libraries, and tests, as well as managing dependencies and packaging the final product. This makes it a valuable tool for anyone working on software projects in the Linux environment.
The article’s major focus is on installing CMake on Ubuntu 22.04. So, for an effective and simple installation, follow the steps listed below:
Method 1: Installing Cmake via GUI in Ubuntu 22.04
If you’re new to Ubuntu or having problems installing a package by typing commands in the Ubuntu terminal, you may instead use the Ubuntu Software Center to install the program, just as you would with the Play Store or the App Store. Follow the steps below if you wish to install CMake via Ubuntu’s Software Centre:
Step 1: Open Ubuntu 22.04 software center as shown in the image below:
Step 2: When you click the link, a new window will open where you need to enter the word “cmake” into the search bar which might take some time, and then it will pop up because of the search.
Step 3: Now you need to click on the application where you will see the option to install it as shown below:
Step 4: After providing one’s Ubuntu password in the following “Authentication needed” dialogue box, the user may proceed by clicking the “Authenticate” button. The file will be downloaded, and setup will start automatically.
Step 5: Following a successful installation, you can verify it by clicking the “Show Applications” button and then searching for CMake.
Step 6: Later you need to click on the application to launch it and then you should be able to see its main interface as shown below:
Removing Cmake via GUI in Ubuntu 22.04
Using the following instructions, you can uninstall CMake from your system.
Step 1: To see a list of currently installed program, launch the Ubuntu Software Center and click the “Installed” tab in the window’s upper-right corner.
Step 2: Then, look for “cmake” in the list and click the “Remove” button to the right of it:
Method 2: Installing Cmake via Terminal
There is another variation of installing the CMake application and that is by installing it via terminal.
There are two methods for installing CMake using the command line:
- Snap Package Manager
- Source code from the CMake website
Installing CMake via Snap Manager
Step1: To install CMake, open the Ubuntu terminal and type in the following command:
$ sudo snap install cmake --classic
You can also remove the CMake application via the terminal using the following command mentioned below:
$ sudo snap remove cmake
Cmake is a free platform that aids in software creation, administration, and packaging. We went through using the Ubuntu Software Center and the Ubuntu Terminal to install and delete cmake, as well as removing cmake entirely in Ubuntu 22.04.