CMake 2026.7.5

学习CMake之前,在linux下需要创建makefile然后使用make的方式去编译工程代码;在windows下需要手动创建visual studio工程文件。不同平台方式不同且非常繁琐。
于是CMake最核心的功能就是:自动生成各个构建系统对应的配置文件,在linux中就是生成makefile;在windows下就是生成.vcxproj文件

CMake下载地址:https://cmake.org/download/
CMake官方英文文档地址:https://cmake.org/cmake/help/latest/index.html
安装下面四个插件
image

helloworld项目演示

简单来说就四步:编写CMake文件 ;运行cmake . (生成makefile);运行make ;运行可执行程序
image
image
image

posted @ 2026-07-06 19:20  Gninrael_Peek  阅读(11)  评论(0)    收藏  举报