Linux QT Creator cmake development environment configuration

Source: Internet
Author: User
Tags gz file

Installation Method: Source code compiled and installed
Software: cmake-3.2.2.tar.gz
: http://www.cmake.org/files/v3.2/Installation Prerequisites

The system already has g++ and ncurses-devel installed, if not installed using the following command:

[Python]View Plaincopy
  1. [[email  protected] /] # apt-get install g++  
  2. [[email protected]/] # apt-get Install Libncurses5-dev different system names may differ, please Baidu
Installing CMake

Upload the cmake-3.2.2.tar.gz file to the/usr/local to do the following:

[Python]View Plaincopy
  1. [[email  protected] local] # cd /usr/local   
  2. [[email protected] local]# tar -zxv -f cmake-3.2.2.tar.gz        //  Decompression Package
  3. [[email protected] local]# cd cmake-3.2.2   
  4. [[email protected] cmake-3.2 2 " # ./configure   
  5. [[email protected] cmake-3.2 2 " # make   
  6. [[email  protected] cmake- 3.2 2 " # make install   
  7. [[email protected] local] # MV cmake-3.2.2 cmake//Modify folder name   
Adding environment variables

Add the variable in the file/etc/profile file with VI to make it permanent:

[Python]View Plaincopy
    1. [[email  protected] local] # vi /etc/profile   //  modify environment variable     

Append the following two lines of code to the end of the file:

[Python]View Plaincopy
  1. Path=/usr/local/cmake/bin: $PATH
  2. Export PATH

Then perform the following actions:

[Python]View Plaincopy
  1. [[email  protected] local] # source /etc/profile   //make the modification effective   
  2. [[email protected] local] # echo $PATH//view PATH value   
Inspection CMake Installation

[Email protected] local]# CMake--version
CMake version 3.2.2


Create a new C + + project for the first CMake

In the "Execute CMake" step of the parameters to fill in the-dcmake_build_type=debug

This allows the program to be debugged in Qt Creator, and the value of-dcmake_build_type can be set to debug or release or Relwithdebinfo.

CMake can automatically generate makefile to build a project with make, but building a project with CMake must also write CMakeLists.txt files.

QT Creator supports the use of Qmake,make,cmake build projects, but not directly to the CMake project to add files,qt Creator support for CMake has yet to be improved.

The temporary practice is to switch to File Manager to add files and then right-click on the project "execute CMake" to make parsing (parsing) take effect and load the file into the project.


Linux QT Creator cmake development environment configuration

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.