当前位置:网站首页>CPP (3) what is cmake

CPP (3) what is cmake

2020-11-07 20:58:02 Coxhuang

List of articles

  • What is? CMake
    • #1 Environmental Science
    • #2 Cpp technological process

What is? CMake

#1 Environmental Science

macOS 10.15.5

#2 Cpp technological process

What is? CMake? You need to know Cpp The process of

  1. With the editor (VSCode/Clion etc. ) Write source code , Such as main.cpp file
  2. Compile the code with the compiler to generate the target file , Such as .o
  3. Use linker to connect object code to generate executable , Such as Windows Under the .exe and Linux The executable under
  • make

If the source file (.cpp) Too much , Compiling one by one will be particularly troublesome , So there was make Tools , It's an automated compilation tool , You can use a single command to achieve full compilation , But developers need to write a rule file ,make Batch compilation based on rule files , This file is makefile

  • CMake

But for a particularly huge project , Write a makefile It's really a very complicated thing , And there it is CMake,CMake Responsible for reading all source files , And then generate it automatically makefile, But at this moment , You need a developer to write a rule file ,CMake This rule file generates makefile, This file is CMakeLists.txt

therefore , One Cpp engineering , From source to run , You can write it manually makefile file , Then compile , Generate an executable file ; You can also write CMakeLists file , adopt CMake Tools , Automatic generation makefile file , Then compile to generate an executable file

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[Coxhuang]所创,转载请带上原文链接,感谢