Cmake linux install debian

Installing CMake

There are several ways to install CMake, depending on your platform.

Windows

There are pre-compiled binaries available on the Download page for Windows as MSI packages and ZIP files. The Windows installer has an option to modify the system PATH environment variable. If that is not selected during installation, one may manually add the install directory (e.g. C:\Program Files\CMake\bin) to the PATH in a command prompt.

One may alternatively download and build CMake from source. The Download page also provides source releases. In order to build CMake from a source tree on Windows, you must first install the latest binary version of CMake because it is used for building the source tree. Once the binary is installed, run it on CMake as you would any other project. Typically this means selecting CMake as the Source directory and then selecting a binary directory for the resulting executables.

macOS

There are pre-compiled binaries available on the Download page for macOS as disk images and tarballs. After copying CMake.app into /Applications (or a custom location), run it and follow the “How to Install For Command Line Use” menu item for instructions to make the command-line tools (e.g. cmake) available in the PATH. Or, one may manually add the install directory (e.g. /Applications/CMake.app/Contents/bin) to the PATH.

One may alternatively download and build CMake from source as in the following section.

Linux, UNIX

There are pre-compiled binaries available on the Download page for some UNIX platforms. One may alternatively download and build CMake from source. The Download page provides source releases. There are two possible approaches for building CMake from a source tree. If there is no existing CMake installation, a bootstrap script is provided:

(Note: the make install step is optional, cmake will run from the build directory.)

By default bootstrap will build CMake without any debug or optimization flags. To enable optimizations you will need to specify the CMAKE_BUILD_TYPE option to bootstrap like this: ./bootstrap — -DCMAKE_BUILD_TYPE:STRING=Release

For more options with bootstrap, run ./bootstrap —help .

Or, an existing CMake installation can be used to build a new version:

(Note: the make install step is optional, cmake will run from the build directory.) If you are not using the GNU C++ compiler, you need to tell the bootstrap script (or cmake) which compiler you want to use. This is done by setting the environment variables CC and CXX before running it. For example:

Читайте также:  Windows события безопасности входа

Download Verification

Each release on the Download page comes with a file named cmake-$version-SHA-256.txt, where $version is the release version number.
One may use this file to verify other downloads, such as the source tarball. For example:

The SHA-256 file itself can be verified by GPG signature:

The GPG key C6C265324BBEBDC350B513D02D2CEF1034921684 is a signing subkey whose expiry is updated yearly.

Источник

How To Install CMake On Ubuntu And Debian

Previously, CMake was introduced to you. To control the software compiler process, this open-sources software uses a simple platform and compiler-independent configuration files. In this way, native makefiles and workspaces would be produced to be used in a compiler environment of choice. Join us with this article to learn How To Install CMake On Ubuntu And Debian. Do not miss 2021 offers on Eldernode to purchase your own Linux VPS.

Table of Contents

Tutorial Install CMake On Ubuntu And Debian

Prepare the latest version of CMake which is available on cmake.org/download/ and Snap Store. Also, pre-compiled binaries are available for some UNIX platforms and you can alternatively download and build CMake from the source. In this article, we will explain how you can install it through the Ubuntu & Debian Software Manager.

To let this tutorial work better, please consider the below Prerequisites:

A non-root user with sudo privileges.

How to install CMake on Ubuntu

Here, we will describe how to install CMake to your Ubuntu both through the UI and the command line. If you prefer to not open the Command line very much, you can install software present in the Ubuntu repository through the UI.

How to install CMake through UI

First, click the Ubuntu Software icon on your Ubuntu desktop Activities toolbar.

Then, if you search ”CMake” in the search bar, the first package listed is the one maintained by the Snap Store. Click on the CMake entry to open the page below:

To start the process of the installation, click on the Install button. Since only one authorized user is able to install software on Ubuntu, the authentication details will be displayed. So, enter your password to let the installation process begin.

Tracking the installation is like the image below:

Once the CMake is installed, you will receive the following message. So, you can choose to directly launch CMake or maybe Remove it if you wish.

How to install CMake through the Ubuntu Command Line

As we mentioned, you can install CMake through the command line. Download the source code from the Official CMake website, compile it and then install CMake through it. The same version could be installed by running the command below:

To download the source code, type:

When the file is downloaded, use the following command to extract it:

To move to the extracted folder, run:

Next, use the following command to compile and install CMake.

Now, you can make it using the command below:

Читайте также:  Английская раскладка клавиатуры при загрузке windows 10

And to install it, type:

Once the installation is completed, you can verify its installation and check the correctness of the installed version. So, run:

When you checked for the latest version, you can use the CLI too to work with your software’s code.

Note: If you have already installed CMake using Ubuntu package manager, use the command below to remove it.

How To uninstall CMake Using The Ubuntu Software

When you decide to remove CMake from your system using the Graphical User Interface, it would not be so difficult. Let’s go through the steps of this part.

Search for ”CMake” on the search bar above. Then, click on the CMake application. The below windows should be displayed.

To uninstall CMake from your Ubuntu system, click on the ”Remove” button.

How to install CMake on Debian

The repository of Debian does not include any of the latest version of CMake. So, you need to download it firstly. Follow the below steps to learn CMake installation on Debian.

When you opened your terminal (Using Ctl+Alt+T) download CMake in your system. Run the command below and wait for the proceeding.

Then, you should extract the downloaded file. So, type:

Now, use the cd command after extracting the director.

At this point, you can run the following command since you have reached the CMake directory. Wait for a while to see CMake will be bootstrapped.

You will do this step when CMake is bootstrapped. So, run the make command in the terminal window. Processing of the make will take time, so do not exit the terminal window and let it reach 100% completion.

Finally, to install CMake, type:

If you wish, verify the process of installation of CMake using the command below:

Once you view the version, you can ensure that the installation is confirmed. Otherwise, check the steps again or send us the error you receive.

Enabled snaps on Debian and install CMake

Also on Debian, you can use snaps to install CMake. Snaps are applications packaged with all their dependencies. Snapes could be run on all Linux distributions from a single build. Snap Store is the best place you can install snaps.

To install snap directly from the command line, run:

Then, use the following commands to install CMake on your Debian Server:

Conclusion

In this article, you learned How To Install CMake On Ubuntu And Debian. Two methods of installing CMake was presented to you for both Ubuntu and Debian. In case you are interested in learning more, find the related article on How To Install CMake On Windows Server.

Источник

Install CMake on Debian 10

Prerequisites

Before proceeding with the installation of CMake on Debian 10, users must need to have:

A non-root user account on their computer systems along with the sudo rights.

Installation of the Latest Version of CMake

To install the latest version of CMake in your computer system follow these steps:

Step 1: Download CMake

Since the global repository of Debian does not provide any of the latest versions of CMake so, to proceed with the installation, we will be downloading it first. Open up the terminal window using the Ctl+Alt+T shortcut key in your Debian system. To download CMake in your system, you need to run the following wget command through the command line:

Читайте также:  Как переустановить операционную систему mac os


The process of CMake download is just like the one displayed in the figure below:


The process might take some time, so do not exit the terminal window any time soon.

Step 2: Extract CMake and run bootstrap

The next step is to extract the downloaded cmake-3.15.2.tar.gz file using the tar command. To do so, append the following command in the terminal window:

Followed by extracting the directory using the cd command, similar to the one displayed below:

Once you have reached the CMake directory, you need to run the bootstrap file to bootstrap CMake. Append the following command in the terminal window:

The output similar to the one displayed will appear on your computer screen.

After some time, CMake will be bootstrapped. Output like this one will confirm the completion.

Step 3: Installation of CMake

The next step is to run the make command. This step is done once CMake has been bootstrapped. Type the following in the terminal window and press the enter key:

When you press the enter key, the make command will begin to execute.

The make process will take time, so make sure that you do not exit the terminal window unless it reaches 100% completion.

After this, the last step is to install CMake using the following make command:

After some time, the process of installation will be completed.


This way users can follow the steps mentioned to easily install the latest version of CMake in their Debian 10 system.

Verification of installation

To verify the process of installation of CMake, type the following command in the terminal window:


As soon as you press the enter key, the installed CMake version will be displayed.

An output similar to the one displayed in the above image will confirm the CMake installation. If you do not receive such output, then you need to retry the steps mentioned above.

Conclusion

In this tutorial, we went through the method of installation of CMake on Debian 10. This is the latest version of CMake, and the steps mentioned above can easily be used to install it on Debian 10 system. We downloaded the latest version of CMake using the wget repository and then extracted the files. Then, we created the make file to continue the installation of CMake. Users can follow all these steps and then easily verify the process of its installation.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

Источник

Оцените статью