Issue
I'm cross-compiling a Linux library for ARM using dockcross and linking to OpenCV. OpenCV builds and installs successfully, but configuring my library gives me errors like this:
CMake Error in build/_deps/mylib-src/CMakeLists.txt:
IMPORTED_LOCATION not set for imported target "opencv_core" configuration
"Release".
I'm finding the OpenCV package like this:
find_package( OpenCV REQUIRED )
And linking like this:
target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS})
I didn't find the documentation for IMPORTED_LOCATION very helpful. What does this error mean, and how do I fix it?
Solution
This worked:
set_target_properties(opencv_core PROPERTIES IMPORTED_LOCATION ${CMAKE_SYSROOT}/usr/local/lib/libopencv_core.so)
But I still don't know why I needed it...
Answered By - TS_ Answer Checked By - Senaida (WPSolving Volunteer)