cmake: remove bundled FindZLIB-NG module

find_package(ZLIB-NG QUIET CONFIG) reads zlib-ng's installed
zlib-ng-config.cmake and the matching zlib-ng-targets-<config>.cmake
files, so the bundled MODULE-mode finder is no longer consulted. The
upstream config knows the correct library names per build configuration
(including the -ngd debug suffix on MSVC), which the bundled finder
didn't.

Fixes #952.
This commit is contained in:
Nathan Moin Vaziri 2026-04-25 00:12:21 -07:00
parent 74609ad447
commit 434593c8af

View file

@ -1,39 +0,0 @@
find_path(ZLIB-NG_INCLUDE_DIRS NAMES zlib-ng.h)
if(ZLIB-NG_INCLUDE_DIRS)
set(ZLIB-NG_LIBRARY_DIRS ${ZLIB-NG_INCLUDE_DIRS})
if("${ZLIB-NG_LIBRARY_DIRS}" MATCHES "/include$")
# Strip off the trailing "/include" in the path.
get_filename_component(ZLIB-NG_LIBRARY_DIRS ${ZLIB-NG_LIBRARY_DIRS} PATH)
endif()
if(EXISTS "${ZLIB-NG_LIBRARY_DIRS}/lib")
set(ZLIB-NG_LIBRARY_DIRS ${ZLIB-NG_LIBRARY_DIRS}/lib)
endif()
endif()
if(BUILD_SHARED_LIBS)
set(LIB_NAMES z-ng zlib-ng libz-ng)
else()
set(LIB_NAMES zlibstatic-ng libz-ng.a z-ng)
endif()
find_library(ZLIB-NG_LIBRARY NAMES ${LIB_NAMES})
set(ZLIB-NG_LIBRARIES ${ZLIB-NG_LIBRARY})
set(ZLIB-NG_INCLUDE_DIRS ${ZLIB-NG_INCLUDE_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZLIB-NG DEFAULT_MSG ZLIB-NG_LIBRARY ZLIB-NG_INCLUDE_DIRS)
if(ZLIB-NG_INCLUDE_DIRS AND ZLIB-NG_LIBRARIES)
set(ZLIB-NG_FOUND ON)
else(ZLIB-NG_INCLUDE_DIRS AND ZLIB-NG_LIBRARIES)
set(ZLIB-NG_FOUND OFF)
endif()
if(ZLIB-NG_FOUND)
message(STATUS "Found zlib-ng: ${ZLIB-NG_LIBRARIES}, ${ZLIB-NG_INCLUDE_DIRS}")
endif()