CMakeLists.txt: Respect FT_DISABLE_ZLIB value
The CMake build uses `find_package` to look for dependencies. Before calling `find_package` it looks to see if the dependency was disabled. If not the associated `_FOUND` variable will be set. This value is then checked to determine if the dependency is added.
However `find_package(PNG)` calls `find_package(ZLIB)` within its find module. So in the case of `FT_DISABLE_ZLIB=TRUE` and `FT_DISABLE_PNG=FALSE` the `ZLIB_FOUND` value can be set and even though `FT_DISABLE_ZLIB` is turned on.
Unset the value of `ZLIB_FOUND` after the call to `find_package(PNG)` so the value is only set when `FT_DISABLE_ZLIB` is turned off.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5971f5..2fb959c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -265,6 +265,8 @@
else ()
find_package(PNG)
endif ()
+ # FreePNG calls FindZLIB so unset ZLIB_FOUND to respect FT_DISABLE_ZLIB
+ unset(ZLIB_FOUND)
endif ()
if (NOT FT_DISABLE_ZLIB)