CMakeLists.txt

这是我的简单的项目目录,针对它该如何写CMakeLists.txt呢。
1  | cmake_minimum_required(VERSION 3.20)  | 
因为我的.h文件都在源码下的src/目录里,所以就有代码include_directories(src)
因为有两个源文件hellow_world.cpp和main.cpp,而且想要生成的exe文件名称是test1,所以就有代码add_executable(test1 src/hellow_world.cpp src/main.cpp)
最后很多关于build和debug的文件都在cmake-build-debug文件夹里面。