CMAKE ZLIB path not found

I am receiving an error while generating files for opencv as below.

CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "zlib" that is not in any export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "ittnotify" that is not in any export set.
CMake Error in CMakeLists.txt:
  export called with target "opencv_core" which requires target "zlib" that
  is not in any export set.


CMake Error in CMakeLists.txt:
  export called with target "opencv_core" which requires target "ittnotify"
  that is not in any export set.


Generating done

I have tried configuring the path to libz with the path /usr/lib/x86_64-linux-gnu/libz.so for the variable ZLIB_LIBRARY_DEBUG in Advanced tab. However this didn’t solve the issue. How exactly should I add this thing in my makefile system please?

Thanks

It looks like you have targets named zlib and ittnotify (probably INTERFACE?). They should be IMPORTED; they then will not be expected to exported by OpenCV (but will need found/made available within opencv-config.cmake).

Hi Ben,

I couldn’t find the opencv-config.cmake, there no such file in the open-cv repo. This is the repo I’m using. GitHub - opencv/opencv: Open Source Computer Vision Library

Thanks

opencv-config is generated by the OpenCV project’s build. Actually doing this is probably best to work with OpenCV developers.