Cmake cannot find a package
For instance
find_package( OpenCV REQUIRED )
And the following error came up
Cmake cannot find a package
For instance
find_package( OpenCV REQUIRED )
And the following error came up
I installed cmake first, OpenCV later. As a result, under the cmake directory C:\Program Files (x86)\CMake\share\cmake-3.2\Modules there isn't a FindOpenCV.cmake file. I then noticed the package configuration file OpenCVConfig.cmake was under the directory C:\local\opencv\build (which is ${OPENCV2411_DIR}). So I added the following line at the top:
set(OpenCV_DIR "C:\\local\\opencv\\build")
Then files are successfully built.