patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

CMake can't find OpenCV under MinGW #226

Closed LiuWenJia-ops closed 5 years ago

LiuWenJia-ops commented 5 years ago

Hey there, I have the problem of Opencv . Under the environment of Windows 10 x64 and opencv 3.4.3( with v14 and v15 binaries). The generator I use is mingw. There is the error ↓

D:\onedrive\codes\dachuang\facemodel\eosmaster\build>cmake -G "MinGW Makefiles" ../eos -DCMAKE_INSTALL_PREFIX=../install/
-- The CXX compiler identification is GNU 6.3.0
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Options:
-- EOS_BUILD_EXAMPLES: ON
-- EOS_BUILD_CERES_EXAMPLE: OFF
-- EOS_BUILD_UTILS: OFF
-- EOS_BUILD_DOCUMENTATION: OFF
-- EOS_GENERATE_PYTHON_BINDINGS: OFF
-- EOS_GENERATE_MATLAB_BINDINGS: OFF
-- Eigen3 found: TRUE, version: 3.3.4
-- Eigen3 include dir found at D:/onedrive/codes/dachuang/facemodel/eosmaster/eos/3rdparty/eigen
CMake Error at examples/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 also "D:/onedrive/codes/dachuang/facemodel/eosmaster/build/CMakeFiles/CMakeOutput.log".

I tried this command under the error information.

D:\onedrive\codes\dachuang\facemodel\eosmaster\build>set OpenCV_DIR=D:\opencv\build But it didn't eliminate the problem. I got the following information.

D:\onedrive\codes\dachuang\facemodel\eosmaster\build>cmake -G "MinGW Makefiles" ../eos -DCMAKE_INSTALL_PREFIX=../install/
-- Options:
-- EOS_BUILD_EXAMPLES: ON
-- EOS_BUILD_CERES_EXAMPLE: OFF
-- EOS_BUILD_UTILS: OFF
-- EOS_BUILD_DOCUMENTATION: OFF
-- EOS_GENERATE_PYTHON_BINDINGS: OFF
-- EOS_GENERATE_MATLAB_BINDINGS: OFF
-- Eigen3 found: TRUE, version: 3.3.4
-- Eigen3 include dir found at D:/onedrive/codes/dachuang/facemodel/eosmaster/eos/3rdparty/eigen
-- OpenCV ARCH: x86
-- OpenCV RUNTIME: mingw
-- OpenCV STATIC: OFF
CMake Warning at D:/opencv/build/OpenCVConfig.cmake:156 (message):
  Found OpenCV Windows Pack but it has no 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):
  examples/CMakeLists.txt:5 (find_package)

CMake Error at examples/CMakeLists.txt:5 (find_package):
  Found package configuration file:

    D:/opencv/build/OpenCVConfig.cmake

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

-- Configuring incomplete, errors occurred!
See also "D:/onedrive/codes/dachuang/facemodel/eosmaster/build/CMakeFiles/CMakeOutput.log".
LiuWenJia-ops commented 5 years ago

Is there any other requirement of OpenCV?

patrikhuber commented 5 years ago

Hi,

This has solely to do with OpenCV and MinGW, and nothing to do with the eos library. I am not familiar with how OpenCV works under MinGW and with CMake, but I am pretty sure you'll find the answer to this with search engines, and if not, the OpenCV forums or StackOverflow are the appropriate places to ask such questions.

The GitHub issues section of eos is for actual issues and development of the library.