# CMAKE ZLIB path not found

**URL:** https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037
**Category:** Usage
**Tags:** os:linux
**Created:** [May 2, 2023, 5:32pm UTC](https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037 "2023-05-02T17:32:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gudimetla\_Kowshik](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gudimetla_kowshik/32/3402_2.png) [@Gudimetla\_Kowshik](https://discourse.cmake.org/u/Gudimetla_Kowshik)
#### Post date: [May 2, 2023, 5:32pm UTC](https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037/1 "2023-05-02T17:32:35Z")

</div>

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

```auto
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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [May 2, 2023, 5:44pm UTC](https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037/2 "2023-05-02T17:44:19Z")

</div>

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`).

---

<div class="post-metadata">

### Author: ![Gudimetla\_Kowshik](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gudimetla_kowshik/32/3402_2.png) [@Gudimetla\_Kowshik](https://discourse.cmake.org/u/Gudimetla_Kowshik)
#### Post date: [May 2, 2023, 7:33pm UTC](https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037/3 "2023-05-02T19:33:28Z")

</div>

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](https://github.com/opencv/opencv)

Thanks

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [May 2, 2023, 8:17pm UTC](https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037/4 "2023-05-02T20:17:39Z")

</div>

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