make 和 cmake 的区别学习

概要

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/