CMakeLists.txt

This commit is contained in:
2026-08-03 15:29:43 +08:00
parent 32d7529967
commit f87523a003
8 changed files with 687 additions and 100 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ set(CMAKE_CXX_STANDARD 17)
file(GLOB_RECURSE SOURCES "*.cpp")
# 遍历所有找到的 .cpp 文件,为每个文件单独创建一个可执行目标
foreach(source ${SOURCES})
foreach (source ${SOURCES})
# 获取文件名(不带扩展名)作为可执行文件的名字
get_filename_component(name ${source} NAME_WE)
add_executable(${name} ${source})
endforeach()
endforeach ()