文件多层次
text.file
main.cpp
CMakeLists.txt
head.file
main.h
function.cpp
CMakeLists.txt
最内层的CMakeList.txt
// head.file内的CMakeList.txt
#查找当前目录下的所有源文件
#并将名称保存到DIR_LIB_SRCS变量
aux_source_directory(. DIR_LIB_SRCS)
#生成链接库cubes
add_library(cubes ${DIR_LIB_SRCS})
最外层的CMakeList.txt
// text.file内的CMakeList.txt