I wrote a CMakeLists.txt for a project in C++, which uses OpenCV libraries. When I try to create the project using cmake, I ge
CMakeLists.txt
I faced the same error. In my case this "OpenCVConfig.cmake" file is located in /usr/local/share/OpenCV. In CMakeLists.txt add the line
set(OpenCV_DIR /usr/local/share/OpenCV)
as suggested by the error message.