【发布时间】:2017-07-20 08:27:45
【问题描述】:
我使用 Android Studio 和 CMakelist 编写 NDK 项目。
但是当我想在 CMakelists.txt 中包含很多 cpp/c 文件时,我找不到一个简单的方法来轻轻地做到这一点。
我需要你的帮助。
这是我的代码的文件树示例:
Cmakelists.txt
src
|__main
|__cpp
|___a.cpp // cpp file
|___a.h
|___aa.c // c file
|___...
|___dirA // a dir
|__b.c // also has c file
|__b.h
|__d.cpp // and cpp file
|__...
|___dirB // another dir
|__xxx.c
|__...
在我的 Cmakelist 中,我使用了
file(GLOB cpp_srcs "src/main/cpp/*.cpp")
这似乎只包含第一个目录层的cpp文件,不包含c文件和子目录的cpp/c文件。
有什么办法吗?目录太深,不想手动添加cpp/c文件。
【问题讨论】:
标签: android-ndk cmake