Ask Your Question
0

error in OpenCVConfig.cmake for OpenCV-android-sdk v. 3.2.0

asked 2017-03-06 11:52:06 -0600

sceetl gravatar image

updated 2017-03-06 15:53:57 -0600

I have a project building a sample camera calibration app for android using cmake. I am using version 3.2.0 of the android sdk from the opencv sourceforge page.

In my CMakeLists.txt I have manually set the OpenCV_DIR to < path_to_OpenCV-android-sdk >/sdk/native/jni/ because that's where OpenCVConfig.cmake is. However, inside OpenCVConfig.cmake, it looks for < abi name >/OpenCVConfig.cmake, which does not exist because in the < abi name > subdirectory there is OpenCVConfig-version.cmake rather than OpenCVConfig.cmake.

In < path_to_OpenCV-android-sdk >/sdk/native/jni/OpenCVConfig.cmake, changing

if(EXISTS "${OpenCV_CONFIG_PATH}/OpenCVConfig.cmake") include("${OpenCV_CONFIG_PATH}/OpenCVConfig.cmake") else()

to

if(EXISTS "${OpenCV_CONFIG_PATH}/OpenCVConfig-version.cmake") include("${OpenCV_CONFIG_PATH}/OpenCVConfig-version.cmake") else()

fixes that problem and allows me to build, but I wanted to check that this is an error before submitting a fix for this. If this is an error, I also would like some info on how to submit a fix to this.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-03-09 16:29:25 -0600

sceetl gravatar image

I solved this by building for android from source, which generated the correct OpenCVConfig.cmake that was able to find the correct OpenCVConfig< abi_name >.cmake

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-03-06 11:52:06 -0600

Seen: 345 times

Last updated: Mar 09 '17