This is probably quite simple.
I have an Android project that uses NDK. I will like to include the opus source code in the native code. I have tried using the ExternalProject_Add property of CMake but my native code still cannot import headers from the Opus library and fails to build.
Below is my ExternalProject_Add definition:
ExternalProject_Add(project_opus
URL https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
BUILD_COMMAND make
INSTALL_COMMAND make install
)
ExternalProject_Get_Property(project_opus install_dir)
include_directories(${install_dir}/include)
add_library(opus SHARED IMPORTED)
add_dependencies(opus project_opus)
target_link_libraries( # Specifies the target library.
native-lib
# Links the target library to the log library
# included in the NDK.
${log-lib} opus oboe OpenSLES)
So, here is the CMakeLists.txt for opus:
Next to this file, you must put this opus.mk file which I borrowed from android-ffmpeg-builder on GitHub:
On the face of it, this only supports ARM build.