如何设置CMake以递归方式扫描给定目录并确定源文件列表?
我的项目是一个共享库.我有一个与此类似的文件夹结构:
/
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
Run Code Online (Sandbox Code Playgroud)
我想避免:
src和include目录src/但是,每个示例都可以拥有自己的构建脚本.