# 将当前所有目录放入V_GLOB
file(GLOB V_GLOB LIST_DIRECTORIES true "*")
# 遍历目录
foreach (item ${V_GLOB})
if (IS_DIRECTORY ${item})
# 如果是目录
add_subdirectory(${item})
endif ()
endforeach ()
cmake add_subdirectory匹配多个目录
发表评论
# 将当前所有目录放入V_GLOB
file(GLOB V_GLOB LIST_DIRECTORIES true "*")
# 遍历目录
foreach (item ${V_GLOB})
if (IS_DIRECTORY ${item})
# 如果是目录
add_subdirectory(${item})
endif ()
endforeach ()