1

I want to build a project which requires opencv. I have set up opencv and added these variables to environment variables:

OPENCV_DIR -> c:\opencv\build\x86\vc12

PATH -> %OPENCV_DIR%\bin

Then I do the following:

mkdir build
cd build
set OpenCV_DIR="C:\opencv\build"
cmake -G "Visual Studio 14 2015" -D OpenCV_DIR=%OpenCV_DIR% ..

But I get these errors:

CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1753 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.61.0

  Boost include path: C:/Program Files/boost_1_61_0

  Could not find the following Boost libraries:

          boost_system
          boost_filesystem
          boost_signals

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:88 (find_package)


CMake Error at CMakeLists.txt:89 (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 also "C:/Users/vahab/Desktop/PartsBasedDetector-master/PartsBasedDetector-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/vahab/Desktop/PartsBasedDetector-master/PartsBasedDetector-master/build/CMakeFiles/CMakeError.log".

For now I don't care about the error with boost library. I just want to know why it doesn't find opencv while I have set up the related variables. I have explored other stackoverflow pages but found no working answer. Can anyone help? Thanks

  • 1
    Possible duplicate of [Could not find module FindOpenCV.cmake ( Error in configuration process)](http://stackoverflow.com/questions/8711109/could-not-find-module-findopencv-cmake-error-in-configuration-process) – GWW Jul 27 '16 at 03:38
  • The file linked in the duplicate question appears to be a dead link but you can find the file [here](https://github.com/opencv/opencv/blob/2f4e38c8313ff313de7c41141d56d945d91f47cf/cmake/OpenCVConfig.cmake) – GWW Jul 27 '16 at 03:42
  • Did you try to add `SET("OpenCV_DIR" "c:/opencv/build")` at the beginning of your CMakeLists.txt ? – Sunreef Jul 27 '16 at 06:14
  • 2
    Possible duplicate of [Cmake doesn't find Boost](http://stackoverflow.com/questions/3808775/cmake-doesnt-find-boost) – usr1234567 Jul 27 '16 at 07:04
  • Make sure the directory you specify contains the file OpenCVConfig.cmake or opencv-config.cmake. OpenCV will often put those files in a subdirectory like share. Either way, the directory that contains the config.cmake file is supposed to be your DIR. – StAlphonzo Aug 02 '16 at 19:25

0 Answers0