This seems to be a bug in CMake: https://gitlab.kitware.com/cmake/cmake/-/issues/20127.
Answer from magjac on askubuntu.comCan't find ZLIB (missing: ZLIB_LIBRARY) Ubuntu 20 CMake
[question] Could NOT find ZLIB following the first tutorial
Cmake not finding zlib
To me this looks like CMake is not complaining about missing include (ZLIB_INCLUDE_DIR) but the zlib library itself...? Would installing the lib itself (zlib1g?) help?
More on reddit.comCould NOT find ZLIB
Quick solution: apt-get install zlib1g-dev
I'll first assume you have ZLib installed somewhere, and my guess is that it's in a non-standard location since CMake find it. If that's true, you can set the location in CMake-gui. You'll need to first click the 'Advanced' checkbox near the top, because the FindZLIB.cmake file has the following line "mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)".
Now you should be able to see the ZLIB_LIBRARY ZLIB_INCLUDE_DIR options and set the correct path.
Hello,
I'm trying to make a tool, but I'm getting this error:
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11")
I have installed zlib using
sudo apt install zlib1g-dev
, and zlib.h is located in /usr/include/, which was suggested in other threads with this problem, but it didn't help. What else can I do?
I've installed the same tool on another computer without problems, so it's not the tool.