我正在尝试使用Android Studio中的CMake为我的Android应用程序构建.so库。 CMakeLists.txt文件如下所示:
cmake_minimum_required(VERSION 3.4.1)
file(GLOB CORE_SOURCES "src/main/cpp/ine/Core/*.cpp")
file(GLOB CORE_HEADERS "src/main/cpp/ine/Core/*.hpp")
file(GLOB LA256_SOURCES "src/main/cpp/ine/Geometry/*.cpp")
file(GLOB LA256_HEADERS "src/main/cpp/ine/Geometry/*.hpp")
file(GLOB PLATFORMS_SOURCES "src/main/cpp/ine/Platforms/*.cpp")
file(GLOB PLATFORMS_HEADERS "src/main/cpp/ine/Platforms/*.hpp")
add_library( naive-lib
SHARED
src/main/cpp/GEngine/Platforms/com_giena_apptest_ine.h
${CORE_SOURCES}
${CORE_HEADERS}
${GEOMETRY_SOURCES}
${GEOMETRY_HEADERS}
${PLATFORMS_SOURCES}
${PLATFORMS_HEADERS}
)
find_library(
log-lib
log )
target_link_libraries( native-lib
android
EGL
GLESv2
${log-lib} )
.cpp,.c与.hpp和.h文件组合良好,但单个.hpp和.h(不包括.cpp和.c)不是。
那么,如何将单个.hpp和.h文件包含到.so中?