<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Mario,<div class=""><br class=""></div><div class="">Do you get different results if you set CMAKE_MODULE_PATH rather than CMAKE_PREFIX_PATH? I wrote a tutorial for how to install a library called librealsense, at the very bottom is what will interest you:</div><div class=""><br class=""></div><div class=""><a href="https://gist.github.com/svenevs/f00ed3898d2af6248921b63254aa8cc1#enable-librealsense-for-other-cmake-projects" class="">https://gist.github.com/svenevs/f00ed3898d2af6248921b63254aa8cc1#enable-librealsense-for-other-cmake-projects</a></div><div class=""><br class=""></div><div class=""><pre class=""><span class="pl-c"><span class="pl-c"> #</span> Allow for `find_package(realsense2)` in CMake projects</span>
<span class="pl-k"> export</span> CMAKE_MODULE_PATH=<span class="pl-s"><span class="pl-pds">"</span>/opt/librealsense/lib/cmake<span class="pl-smi">${CMAKE_MODULE_PATH<span class="pl-k">:</span>+<span class="pl-k">:</span><span class="pl-smi">${CMAKE_MODULE_PATH}</span>}</span><span class="pl-pds">"</span></span></pre><div class=""><br class=""></div></div><div class="">This environment variable can either be set, or specified like you are doing with cmake .. -DCMAKE_MODULE_PATH=“/data/thirdparty”, <b class="">noting</b> that depending on where it got installed you may also need an extra <b class="">lib</b> on that path</div><div class=""><br class=""></div><div class=""> /data/thirdparty/<b class="">lib</b></div><div class=""><b class=""><br class=""></b></div><div class="">I’m sure others on this list know the “right” practice, but when CMAKE_INSTALL_PREFIX=/usr/local, it’s very common to see two possible install locations:</div><div class=""><br class=""></div><div class=""> /usr/local/cmake</div><div class=""> /usr/local/lib/cmake</div><div class=""><br class=""></div><div class="">AKA just make sure that the zlib folder is a child directory. In the librealsense2 example, I have</div><div class=""><br class=""></div><div class=""> $ ls /opt/librealsense2/lib/cmake/</div><div class=""> realsense2/</div><div class=""><br class=""></div><div class="">So since /opt/librealsense2/lib/cmake is in my CMAKE_MODULE_PATH, when I do find_package(realsense2), it will find that directory.</div><div class=""><br class=""></div><div class="">I don’t know exactly what Zlib’s install looks like, and I know it matters whether they are using “new” or “old” cmake installation tactics, but hopefully this gets you closer to solving it!</div><div class=""><br class=""></div><div class="">-Stephen</div><div class=""><br class=""></div></body></html>