Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Gradle Plugin fails to find OpenCV from OpenCV_ROOT #11

Open
TimPushkin opened this issue May 17, 2022 · 1 comment
Open

Android Gradle Plugin fails to find OpenCV from OpenCV_ROOT #11

TimPushkin opened this issue May 17, 2022 · 1 comment

Comments

@TimPushkin
Copy link
Owner

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).

@TimPushkin
Copy link
Owner Author

Seems like it can be fixed with set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant