Installation and configuration of the CMake tool under CentOS 6.5

Source: Internet
Author: User
Tags echo command

What is CMake?

CMake is a cross-platform installation (compilation) tool that can be used to describe the installation of all platforms (the compilation process) with simple statements. He is able to output a variety of Makefile or project files that can test the C + + features supported by the compiler, similar to the Automake under UNIX. CMake can compile the source code, make the library, generate the adapter (wrapper), and can construct the execution file in any order. CMake supports In-place construction (binary files and source code in the same directory tree) and out-of-place constructs (binary files in other directories), so it is easy to construct multiple binaries from the same source directory tree. CMake also supports the construction of static and dynamic libraries.

The name "CMake" is the abbreviation for "Cross platform make". Although the name contains "make", the common "make" system on CMake and UNIX is separate and more advanced.

Second, the installation of CMake tools:

0. Installing the GCC SDK and Development library using the Yum command

Yum-y Groupinstall "Development Tools"

1. Download the source installation package: cmake-3.6.0.tar.gz (: https://cmake.org/files/v3.6/cmake-3.6.0.tar.gz)

or use command: wget https://cmake.org/files/v3.6/cmake-3.6.0.tar.gz

2. Create a new user name and group

GROUPADD-G 501 Train

Useradd-g Train-u 501-m operation

3. Switch to the operation user and create a new Bak file directory

Su-operation

mkdir Bak

4. Use the CD command to enter the Bak directory, and then use the RZ command to upload the CMake source installation package [cmake-3.6.0.tar.gz] to/home/operation/bak directory

CD back

Rz

5. Use the exit command to exit the root user, then use the CD command to enter the BAK directory "We use the root user to install the CMake tool"

Exit

CD bak

6. Use the TAR command to extract the cmake-3.6.0.tar.gz source package

TAR-XZVF cmake-3.6.0.tar.gz

6. Use the CD command to enter the cmake-3.6.0 directory and then use the LL command to view the contents of the file in the cmake-3.6.0 directory

CD cmake-3.6.0

ll

7. Configuring, compiling, installing CMake

The first step of the source code installation, the main role is to configure the software to be installed, check whether the current environment is satisfied to install the software dependencies, but not all the tar package is the source code of the package, landlord can see LS there configure this file, maybe you under the binary package, If it is a binary package, it can be used directly after decompression.

./configure

Compile according to the content specified in Makefile, and the resulting executable file is placed in the current directory or in a subdirectory.

Make

Installing make-generated files into the system directory

Make install

8. Add a variable to the file/etc/profile file with the VI command to make it permanently valid

Vi/etc/profile

9. Add three lines of code at the end of the file

#cmake Tools

Path=/home/operation/cmake-3.6.0/bin: $PATH

Export PATH

10. Use the source command to make the file you just modified take effect, and then use the Echo command to view the value of the path

Source/etc/profile

Echo $PATH

11. Check if CMake is installed successfully, if the following message is displayed congratulations, CMake has been installed successfully!

CMake--version

Installation and configuration of CMake tools under CentOS 6.5

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.