Writing the Makefile of CMakeLists.txt

gcc, make, cmake difference and contact:

(. 1) is GNU Compiler Collection gcc compiler can compile a variety of programming languages, such as C / C ++ and the like; and when multiple source files needed to compile individually with gcc command, and the large amount of work is chaotic;

(2) make a batch tool can be seen as a tool only, which itself does not function compile and link, but to be compiled and linked via a user-specified command to call the Makefile; when a large project, the Makefile manually write very troublesome, but after changing the platform have to rewrite the Makefile that does not support cross-platform;

(3) cmake a cross-platform build tools (such as the Unix Makefile file, Windows of Visual Studio project, Mac Xcode project), cmake command to generate the Makefile according to CMakeLists.txt file, make command generates source code can be compiled according to the Makefile execute programs or shared libraries; users only need to write to CMakeLists.txt file , follow these steps:

# 1 specifies the minimum version number cmake

cmake_mininum_required(VERSION xxx)

#2 

Guess you like

Origin www.cnblogs.com/bo1990/p/11419639.html