Files
openwrt/tools/cmake/patches/140-zlib.patch
Hannu Nyman 1b48ebd31c tools/cmake: update to 4.1.2
Update cmake to 4.1.2.
Note that cmake 4.x requires at least 3.5 as 'cmake_minimum_required'
in CMakeLists.txt of each app to be compiled.

Future cmake versions will increase that requirement to 3.10
https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/20265
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-04 15:14:55 +01:00

21 lines
717 B
Diff

--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -147,10 +147,13 @@ else()
set(ZLIB_NAMES_DEBUG zd zlibd zdlld zlibd1 zlib1d zlibstaticd zlibwapid zlibvcd zlibstatd)
endif()
-# Try each search configuration.
-foreach(search ${_ZLIB_SEARCHES})
- find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
-endforeach()
+if(UNIX)
+ find_package(PkgConfig QUIET)
+ pkg_search_module(PC_zlib zlib)
+endif()
+
+find_path(ZLIB_INCLUDE_DIR zlib.h HINTS ${PC_zlib_INCLUDEDIR} ${PC_zlib_INCLUDE_DIRS})
+find_library(ZLIB_LIBRARY NAMES z HINTS ${PC_zlib_LIBDIR} ${PC_zlib_LIBRARY_DIRS})
# Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library
if(NOT ZLIB_LIBRARY)