make 和 cmake 的区别学习

博客

博客地址:IT老兵驿站

正文

“The build process has one step if you use a Makefile, namely typing “make” at the command line. For CMake, there are two steps: First, you need to setup your build environment (either by typing cmake <source_dir> in your build directory or by running some GUI client). This creates a makefile or something equivalent, depending on the build system of your choice (e.g. Make on *nix, VC++ or MinGW on Windows, etc). The build system can be passed to CMake as a parameter. However, CMake makes reasonable default choices depending on your system configuration. Second, you perform the actual build in the selected build system.”

参考上文所说,cmake 是两步,通过执行cmake <source_dir>(根据CMakeLists.txt文件的配置), 先根据环境生成 Makefile 文件,然后正常使用 make 去进行编译。

传统的make,我这里的理解是通过configure去扫描软件的依赖,然后根据Makefile.in(往往是通过automake等工具所生成的),生成Makefile

cmake更多是帮助进行跨平台的编译。

初步理解是这样,等待以后来完善。

参考

https://www.quora.com/What-is-the-difference-between-CMake-and-make
https://prateekvjoshi.com/2014/02/01/cmake-vs-make/

相关文章:

  • 2022-12-23
  • 2021-12-06
  • 2021-07-12
  • 2021-07-14
  • 2021-10-17
  • 2022-12-23
  • 2021-04-10
猜你喜欢
  • 2021-09-05
  • 2022-01-11
  • 2021-11-17
  • 2021-12-25
  • 2022-12-23
  • 2021-04-19
  • 2021-09-30
相关资源
相似解决方案