I'm trying to compile a project with CMAKE and make with MinGW32-make.exe. My CMakeLists.txt looks like so:
#####################################
cmake_minimum_required (VERSION 3.0)
project (TestProject)
find_package(OpenCV REQUIRED)
include_directories(${OPENCV_INCLUDE_DIR})
add_executable (main.exe main.cpp)
#####################################
Running "CMAKE -G "MinGW Makefiles" runs fine, but when I try to make with "MinGW32-make.exe" I get the following error:
25:39: fatal error: opencv2/highgui/highgui.hpp: No such file or directory
#include "opencv2/highgui/highgui.hpp"
When I look in the Makefile, I can't find the text "OpenCV" anywhere. In which file is the OPENCV directory supposed to be identified?
OpenCV_INCLUDE_DIRS
variable which contains directory with OpenCV headers. You should use it instead ofOPENCV_INCLUDE_DIR
forinclude_directories()
call. You may output content of variable usingmessage()
command. Note, that directory path needn't to contain OpenCV substring. – Tsyvarev