Mat*_*ira 38 build-automation build-process build cmake build-system
如何设置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/
但是,每个示例都可以拥有自己的构建脚本.
And*_*aev 42
CMake为递归文件提供以下命令:
file(GLOB_RECURSE variable [RELATIVE path]
[FOLLOW_SYMLINKS] [globbing expressions]...)
Run Code Online (Sandbox Code Playgroud)
命令文档:http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:file
归档时间: |
|
查看次数: |
27143 次 |
最近记录: |