0

I'm trying to cross compile to an ARM target, which already has a fakeroot directory with OpenCV installed. When using find_package(OpenCV), it manages to find the OpenCV directory (after setting CMAKE_FIND_ROOT_PATH to the fakeroot directory), but then it says:

CMake Error at /fakeroot/usr/lib/cmake/opencv4/OpenCVModules.cmake:379 (message):
  The imported target "opencv_core" references the file

     "/usr/lib/libopencv_core.so.4.1.0"

Can I add a prefix to point to the correct location of the file?

sosiris
  • 1
  • 1
  • 2
  • Welcome to Stack Overflow! There are a few questions about this topic already on Stack Overflow! Have you seen and tried what is suggested [here](https://stackoverflow.com/a/8714718/3987854) or [here](https://stackoverflow.com/a/49816516/3987854)? Does your fakeroot OpenCV installation contain a `OpenCVConfig.cmake` or `OpenCV-config.cmake` file? – Kevin Apr 23 '20 at 11:18
  • Thanks you for the reply. The threads you referenced are discussing a different problem. In my case CMake manages to find the package, as my fakeroot contains `OpenCVConfig.cmake`, but this file references to libraries and include directories which are relative to the fakeroot (e.g. `/usr/lib/libopencv_core.so.4.1.0`, which in my case is `/fakeroot//usr/lib/libopencv_core.so.4.1.0`). – sosiris Apr 24 '20 at 18:58

0 Answers0