You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZLIB and PNG have horrid modern CMake support. It is generally done by setting ZLIB_ROOT nowadays, however it doesn't play along with FetchContent at all. You have to relay your fetched ZLIB towards your fetched PNG.
^ Works by creating a local ALIAS target called zlibstatic, and then works around find_pakage(ZLIB) in png's cmake config by setting ZLIB_LIBRARY and ZLIB_INCLUDE_DIR manually. ZLIB_ROOT is still required for some reason. I've tried many other things, but this seems to be the only thing that works. If anyone gets a better idea, please share. I've tested building on windows/linux, with g++/clang/cl/clang-cl.
PS: fetch_external_module is just a wrapper for FetchContent_Declare and FetchContent_MakeAvailable - you can find it here.
I try build libpng using Cmake::FetchContent
But i have error:
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Is there any way to fix this?
Where is the problem? In libpng or zlib?
I tested Linux (gcc), Windows (msvc, msys2-clang)
It doesn't work anywhere
full repo https://github.com/mariuszmaximus/libpng_usage.git
The text was updated successfully, but these errors were encountered: