CMake error in CMakeLists.txt CMAKE_PREFIX_PATH

I downloaded the face-analysis SDK source code from http://face.ci2cv.net/ . Now I am trying to run it. I downloaded all the required software and followed the installation instructions. When I try cmake [options] .. I get an error.

CMake Error at CMakeLists.txt:21(find_package):
Could not find a package configuration file provided by "OpenCV" with any of the following names:
OpenCVConfig.cmake
opencv-comfig.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. 

      

CMakeLists.txt looks like this

# -*-cmake-*-
PROJECT(CSIRO-FaceAnalysis-SDK)

cmake_minimum_required(VERSION 2.8)

#set(CMAKE_VERBOSE_MAKEFILE true)

# Default values for options
if(NOT DEFINED OpenCV_PREFIX)
  set(OpenCV_PREFIX ${CMAKE_INSTALL_PREFIX})
endif()


  set(OpenCV_PREFIX C:/Program Files/Development/opencv/build)
endif(
# Configurable options
OPTION(WITH_GUI "Build the GUI" OFF)

# Third party libraries
find_package(OpenCV REQUIRED core highgui imgproc objdetect
  PATHS ${OpenCV_PREFIX}/lib/cmake/
        ${OpenCV_PREFIX}/share/OpenCV/
  NO_DEFAULT_PATH) # For some reason CMake uses its defaults before the above paths.

      

Please help me, I have no idea what to do.

Thanks, B

+3


source to share


1 answer


  • Make sure you have OpenCV installed on your system. Pay attention to the folder where it is installed. For example:C:\OpenCV

  • Run CMake with a command line similar to

cmake -DCMAKE_PREFIX_PATH = "C: \ OpenCV" ..

OR



find the folder containing OpenCVConfig.cmake (for example C: \ OpenCV \ build \ x86 \ vc10 \ lib) and pass it to CMake via the OpenCV_DIR variable

cmake -DOpenCV_DIR = "C: \ OpenCV \ build \ x86 \ vc10 \ lib" ..

In both cases, I think the vendor of the code you are trying to compile has made the mistake of putting NO_DEFAULT_PATH

in find_package(OpenCV ...)

. If nothing works, please try again after removing this flag.

+6


source







All Articles