CMake is a set of tools that allows you to create, test and package software. This family of tools is available on several platforms and is distributed under open source. CMake is often used to simplify the compilation process created by using a simple cross-platform configuration files.Also using the CMake generated makefiles special sets of instructions that allow you to use the compiler in the future in the automation Assembly.
The author of the CMake is a team of Kitware. The creation of this software was motivated by the need to develop a powerful environment that could work on multiple platforms with projects where open source code (primarily the Insight Segmentation and Registration Toolkit and the Visualization Toolkit). In this article you will learn how to install CMake Ubuntu using a graphical interface or the command line. If you are trying to get a program and get error in cmake not found, then this article will be very useful for you.
Installing CMake in Ubuntu
1. Application Manager
At the time of writing of this article used the latest version of CMake (3.15.2). It was available in the framework of well-known store Snap Store. Below you’ll learn how to install CMake in using the standard app Manager in Ubuntu.
If you don’t want to spend a lot of time to interact with the command line, the GUI should please you because of its simplicity. On the toolbar located on the left side, click application Manager.
In the upper part of the window that opens click on the search icon and in the appeared prompt, type CMake. The results appear as follows:
The first package in the search results — this is the file we need, is available within the store Snap Store. Click on that entry and you’ll come to a section with detailed information about the app, which will look like this:
Click Installto start the install process of CMake. You may have to enter your password in the login window, which will appear immediately after you click Install. This is one of the forms of protection in Ubuntu — only an authorized user can install the software in the system.
Enter your password and click Enter. After that you can monitor the installation status displayed on the graphical indicator.
After successful installation the system will give you the following message:
From this window it is already possible to run CMake (or immediately, for example, delete).
2. Package Manager and apt to snap
The same version of CMake you can install via the command line, if you use the following command:
snap install cmake sudo
Install cmake ubuntu 18.04 from the official repositories is performed with the command:
sudo apt install cmake
3. Build CMake from source
If for some reason you don’t want to use a graphical interface, or you want the latest version, you can resort to the command line. We will have to download the source code from the official website (https://cmake.org/download/), compile it, and then install it.
Open a command prompt — to do this, either find the Terminal application, or press the key combination Ctrl+Alt+T. Enter the command that will start the download of the source code:
When tar.gz fully downloaded, it should unpack. I use the following command:
Go via terminal to the folder with the unpacked files:
To perform the compilation of downloaded code, do another command:
After correct execution of all operations, the command line produces the following result:
You can now start the installation process with a simple command:
Then perform another command:
sudo make install
The installation process is completed. Now you can check the version of CMake to verify the correctness of their actions.
At the time of this writing, CMake was available in version 1.15.2 with which we worked. Now you can use this tool to perform their job tasks.
How to uninstall CMake?
If you decide to uninstall the CMake that was installed via the Manager application, then this process will occur in the following way. Again, open the application Manageron the list, locate CMake (next to it it says Installed). Click on the application icon, continue to the next screen and find the button to Remove. So will run the uninstall process.
After that, the system again prompts you to enter you password and immediately after that the application will be removed.