有CMakerecursion扫描文件夹?
如何设置CMakerecursion扫描给定的目录并确定源文件列表?
我的项目是一个共享库。 我有一个类似于这样的文件夹结构:
/ src/ # Source files in an arbitrary tree include/ # Headers, tree mirrors that of the src/ folder examples/ # Executable code examples that link against the library CMakeLists.txt 我想避免:
-  用无穷的CMakeLists.txt文件污染src/和include/目录
- 每次更改文件夹结构时都必须更改和修改脚本
不过,每个例子都有自己的构build脚本。
CMake为recursion文件提供以下命令:
 file(GLOB_RECURSE variable [RELATIVE path] [FOLLOW_SYMLINKS] [globbing expressions]...) 
命令文档: http : //www.cmake.org/cmake/help/v2.8.8/cmake.html#command : file