cmake在linux下安装教程,如何在 Linux 上下载、编译和安装 CMake

c4468b3f4df77e96b0a416fa2a870fba.png

CMake is a cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software.

Here are the simple steps to download, configure, compile, and install CMake on a Linux machine. I have tested these instructions on Debian/Ubuntu Linux distributions but they should work on all Linux machines where compilers and make utilities are installed. Please take a look at?configuring Ubuntu Linux after installation?to configure your Debian/Ubuntu Linux box for the required tools.

Please make sure you check the downloaded file's integrity before unzipping it. '#' (w/o quotes) in front of commands below means you have to run the command as root user (or use sudo?instead if your system supports that).

Download:

$ wget http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz

Extration of cmake source code from downloaded file:

$ tar xzf cmake-2.8.3.tar.gz

$ cd cmake-2.8.3

Configuration:

If you want to see the available conifuration options, run command below.

$ ./configure --help

In order to configure cmake before installation, run command below.

$ ./configure --prefix=/opt/cmake

We basically instructed the install script to install CMake in /opt/cmake.

Compilation:

$ make

Installation:

# make install

Verification:

After installation without any errors you can verify the installation by running the command below:

$ /opt/cmake/bin/cmake -version

The output should look something like below (depending upon cmake version you are installing).

cmake version 2.8.3

Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值