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
- [[email protected] /] # apt-get install g++  
- [[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
- [[email protected] local] # cd /usr/local   
- [[email protected] local]# tar -zxv -f cmake-3.2.2.tar.gz // Decompression Package
- [[email protected] local]# cd cmake-3.2.2   
- [[email protected] cmake-3.2 2 " # ./configure   
- [[email protected] cmake-3.2 2 " # make   
- [[email protected] cmake- 3.2 2 " # make install   
- [[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
- [[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
- Path=/usr/local/cmake/bin: $PATH
- Export PATH
Then perform the following actions:
[Python]View Plaincopy
- [[email protected] local] # source /etc/profile //make the modification effective   
- [[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