"OpenCV" is considered to be NOT FOUND
Asked Answered
M

5

10

Linux Flavor: Debian (Crunch Bang)

Problem Occurred: When attempting to build cvblobs with the following command

cd ~/cvblob
cmake .

Error:

CMake Error at cvBlob/CMakeLists.txt:20 (find_package):
 Found package configuration file:

/usr/local/share/OpenCV/OpenCVConfig.cmake

but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.


-- Configuring incomplete, errors occurred!
Morning answered 20/8, 2013 at 4:54 Comment(2)
Could be that the installed version is too old. The version decision is made by the config file of the project to search for. Does cvblob request a specific opencv version in the find_package call?Hydroxyl
If you had this problem when working with Android projects, take care of your minSdkVersion.Amadaamadas
M
5

Well I met a similar problem when I was going with some other open source face detection modules rather than cvblobs. Actually you will find that before these lines of error-info, there are:

CMake Warning at /usr/local/opencv-2.4.13/cmake/OpenCVConfig.cmake:163 (message):
  Found OpenCV Windows Pack but it has not binaries compatible with your configuration.

  You should manually point CMake variable OpenCV_DIR to your build of OpenCV library.
Call Stack (most recent call first):
  CMakeLists.txt:57 (find_package)


CMake Warning at CMakeLists.txt:57 (find_package):
  Found package configuration file:

    /usr/local/opencv-2.4.13/cmake/OpenCVConfig.cmake

but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.

So you may notice that it asks you to manually point out the directory of you build version of OpenCV library. For me, my source codes are at

/usr/local/opencv-2.4.13/

but I make and install my release build of OpenCV at

/usr/local/opencv-2.4.13/release/

so I use: cmake -D OpenCV_DIR=/usr/local/opencv-2.4.13/release/ .. and everything works:)

Mweru answered 27/9, 2016 at 17:53 Comment(1)
0 Thanks! I had a similar mistake. I appended 'build' after the source directory. After I removed 'build' from the path, it worked.Duel
Q
4

When I compile a program that use OpenCV lib, vision 2.4.8, occurs the similar error, when I point manually Opencv_DIR path to opencv/build ,visio 3.1.0, error occurred like you.

Then I point Opencv_DIR path to opencv/build whose vision is same to the program used. It works.

Quirita answered 27/5, 2017 at 10:16 Comment(0)
S
1

One of the reason could be the another OpenCV package in another path, that you had installed before. In my case, I had already installed OpenCV for Python in Anaconda package, and the CMake always wanted to refer me to that package.

I simply added:

set(OpenCV_FOUND 1)

to my CMakeList.txt file, this command simply override the other package you may had installed. The final version of CMakeList file which is working for me would be this:

set( OpenCV_FOUND 1 )
find_package(OpenCV 2.4.13 REQUIRED PATHS "C:/opencv")
set(SOURCE_FILES main.cpp)
add_executable(OpenCV_Test ${SOURCE_FILES})

Note:

1- I am using the CMakeList.txt file for Clion IDE

2- I am using it under windows. Probably you may set the relevant path if you use other OS

3- You need also change the OpenCV version if you use other version

Spall answered 26/8, 2017 at 5:51 Comment(0)
E
0

the "set(OpenCV_FOUND 1) in CMakeLists.txt file" answer did not work for me, so instead: I changed the value of OpenCV_FOUND to TRUE directly on the "/opencv/build/OpenCVConfig.cmake" file

/opencv/build directory

openCV_FOUND value is False

openCV_FOUND value is set to True

Earplug answered 12/10, 2023 at 22:51 Comment(1)
Please provide textual information as text, at least in addition to pictures of text, because meta.#286051Dwan
F
0

Downloading the latest version of MinGW worked for me. link: https://sourceforge.net/projects/mingw-w64/files/

Finedraw answered 19/6 at 13:54 Comment(1)
The question is about Debian but MinGW is for Windows. Maybe clarify that your answer is specific to Windows only.Scheming

© 2022 - 2024 — McMap. All rights reserved.