Dear Stephen, thanks for your great help, I certainly learned something! But for my current problem, zlib generally uses autotools to build, and the find_package(ZLIB) is in my case looking for the library, not the cmake config. Would your idea of CMAKE_MODULE_PATH apply to that?
All the best, Mario On 21.03.2018 20:12, Stephen McDowell wrote: > Hi Mario, > > 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: > > https://gist.github.com/svenevs/f00ed3898d2af6248921b63254aa8cc1#enable-librealsense-for-other-cmake-projects > > # Allow for `find_package(realsense2)` in CMake projects > export > CMAKE_MODULE_PATH="/opt/librealsense/lib/cmake${CMAKE_MODULE_PATH:+:${CMAKE_MODULE_PATH}}" > > > This environment variable can either be set, or specified like you are doing > with cmake .. -DCMAKE_MODULE_PATH=“/data/thirdparty”, *noting* that depending > on > where it got installed you may also need an extra *lib* on that path > > /data/thirdparty/*lib* > * > * > 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: > > /usr/local/cmake > /usr/local/lib/cmake > > AKA just make sure that the zlib folder is a child directory. In the > librealsense2 example, I have > > $ ls /opt/librealsense2/lib/cmake/ > realsense2/ > > So since /opt/librealsense2/lib/cmake is in my CMAKE_MODULE_PATH, when I do > find_package(realsense2), it will find that directory. > > 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! > > -Stephen > > > Viele Gruesse, Mario Emmenlauer -- BioDataAnalysis GmbH, Mario Emmenlauer Tel. Buero: +49-89-74677203 Balanstr. 43 mailto: memmenlauer * biodataanalysis.de D-81669 München http://www.biodataanalysis.de/ -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake