Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake problem #16

Open
duducode opened this issue May 15, 2020 · 1 comment
Open

cmake problem #16

duducode opened this issue May 15, 2020 · 1 comment

Comments

@duducode
Copy link

The following configuration files were considered but not accepted:

/usr/share/OpenCV/OpenCVConfig.cmake, version: 2.4.9.1
@lingxuxiong
Copy link

The latest example code requires exactly OpenCV version 3.0.0 installed, if not, compiling will most probably end up with CMake errors similar to what follows:

  Could not find a configuration file for package "OpenCV" that is compatible
  with requested version "3.0.0".

  The following configuration files were considered but not accepted:

    /Users/nling/opencv/installation/OpenCV-master-debug/lib/cmake/opencv4/OpenCVConfig.cmake, version: 4.5.2

it means, the installed version is not matched with the required one. to fix this, you need to remove the specific OpenCV version or change it to the same version as installed on the dev machine.

# ./example/CMakeLists.txt
find_package(OpenCV REQUIRED COMPONENTS core imgcodecs imgproc highgui)

or

find_package(OpenCV 4.5.2 REQUIRED COMPONENTS core imgcodecs imgproc highgui)

Btw, if libomp is not installed on MacOS, OpenMP related error will arise,

(base) ➜  build git:(master) ✗ cmake ..
-- CMAKE_INSTALL_PREFIX = /usr/local
-- Found OpenCV: /Users/nling/opencv/installation/OpenCV-master-debug (found version "4.5.2") found components: core imgcodecs imgproc highgui
CMake Error at /usr/local/lib/python3.9/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)

ran brew install libomp fixed it, see MacOS, CMake and OpenMP for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants