Description
When I append a path to OpenCV into OpenCV_ROOT
find_package
doesn't consider this path even though it lists it in OpenCV_ROOT
when CMake is run from Android Gradle Plugin. The same CMake script works fine on a usual CMake. The issue is described here in more detail.
The current solution is to iteratively set OpenCV_DIR
to each path that was intended to be appended to OpenCV_ROOT
and call find_package
to determine if this path is correct. Firstly, this solution has a clear overhead, secondly, CMake adds each of the OpenCVConfig.cmake
considered this way into build even if it doesn't correspond to a found package (and this results into another hack in BuildOpenCV.cmake
where I have to patch OpenCVConfig-version.cmake
insted of OpenCVConfig.cmake
so it doesn't get added into the build).