更新时间:2023-09-18 08:15:40
您可以将所有头文件/源文件放入相同的文件夹并使用类似的东西
You can put all header/source files in the same folder and use something like
file(GLOB SOURCES
header-folder/*.h
source-folder/*.cpp
)
add_executable(yourProj ${SOURCES})
通过这种方式,您可以执行以下两种方法之一,将新添加的标头/源添加到VS:
In this way, you can do either of the following two methods to add new added header/source into VS:
CMakeLists.txt
,例如只需添加一个空格。然后在VS中构建解决方案,它将自动添加新的头文件/源文件。CMakeLists.txt
a little bit, e.g. simply add a space. And then build your solution in VS, it will automatically add new header/source files.