#Trying to setup opencv with cmake :(

9 messages · Page 1 of 1 (latest)

hollow tapir
#

Following this tutorial: https://www.youtube.com/watch?v=CnXUTG9XYGI
At 3:50 in the tutorial he writes in to the terminal ( mkdir build ) and ( cmake -B .\build\ ).
After running cmake -B .\build\ this error happened:

CMake Error at CMakeLists.txt:5 (find_package):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.

Could not find a package configuration file provided by "OpenCV" with any
of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!

SEE THE IMAGE FOR FULL TERMINAL

I will show you how to install OpenCV C++ in Windows 10 and use it in debug and release using VS Code and CMake. I will go over installing CMake, downloading OpenCV build files, setting up your environment variables, creating the CMakeLists.txt, making a simple OpenCV program, configure the build, build the OpenCV project in debug, build the O...

▶ Play video
deep crowBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

hollow tapir
#

CMakeLists.txt:

#

cmake_minimum_required(VERSION 3.0)
project(OpenCVExample)

Find OpenCV package

find_package(OpenCV REQUIRED)

Include directories from OpenCV

include_directories(${OpenCV_INCLUDE_DIRS})

Create an executable

add_executable(OpenCVExample main.cpp)

Link OpenCV Libraries

target_link_libraries(OpenCVExample ${OpenCV_LIBS})

#

TERMINAL:

#

!solvedf

#

!solved

deep crowBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity