prefab oboe REQUIRED CONFIG not found in Cmdline-tools (version 6858069)

861 views Asked by At

I've implemented oboe in my android project using prefab with the find_package(oboe REQUIRED CONFIG) line in my CMakeLists.txt file

In Android studio 4.1.1 works like a charm, I'm able to use oboe seamlessly.

However, in my Jenkins instance which checks pull requests and executes a battery of tests, I'm using the stand-alone cmdline-tools on its latest version at the moment(version 6858069) instead of the android studio provided sdk, and it looks like prefab is either not working or not present. I'm getting the following error.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':audioLib:externalNativeBuildCleanRelease'.

Build command failed. Error while executing process /opt/android_sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /var/jenkins_home/workspace/PR-Checker/audioLib/.cxx/cmake/release/armeabi-v7a clean} ninja: Entering directory `/var/jenkins_home/workspace/PR-Checker/audioLib/.cxx/cmake/release/armeabi-v7a' [0/1] Re-running CMake... -- Configuring incomplete, errors occurred! See also "/var/jenkins_home/workspace/PR-Checker/audioLib/.cxx/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log". FAILED: build.ninja /opt/android_sdk/cmake/3.10.2.4988404/bin/cmake -H/var/jenkins_home/workspace/PR-Checker/audioLib -B/var/jenkins_home/workspace/PR-Checker/audioLib/.cxx/cmake/release/armeabi-v7a

CMake Error at CMakeLists.txt:192 (find_package):
Could not find a package configuration file provided by "oboe" with any of
the following names:

  oboeConfig.cmake
  oboe-config.cmake

Add the installation prefix of "oboe" to CMAKE_PREFIX_PATH or set
"oboe_DIR" to a directory containing one of the above files.  If "oboe"
provides a separate development package or SDK, be sure it has been
installed.


ninja: error: rebuilding 'build.ninja': subcommand failed

my CMakeLists.txt file contains:

add_library( src/main/cpp/.../myoboe.cpp)
find_package (oboe REQUIRED CONFIG)

target_link_libraries(
        audio-native
        oboe::oboe
)

How can I make it work?

I'm trying to avoid adding oboe as a local sub-module, as my project has other developers and I would like to make it simple for them as well. I have the option of changing the CMakeLists.txt file with scripting in Jenkins previous to compiling, but that means I would have to update the oboe version in Jenkins every time it changes in my gradle file, so if there is a way to avoid that it would be great.

UPDATE: I've managed to make it work by downloading the oboe library and including it in the CMakeLists.txt using a script that replaces text. However, this approach intends double maintenance every time I update the library in the future. So I still need to solve the issue with using the gradle implementation way.

0

There are 0 answers