ITADN

Cmake Zlib FetchContent Surport

#495Closedimcloud 创建于 2025-06-07
enhancementhelp wanted
I
imcloudcommented
**Description** I want libzip to support Zlib via FetchContent, not just through find_package(ZLIB). This would allow more flexible and modern CMake integration, with the option to download Zlib or use a local source tree as needed. **Solution** Make libzip compatible with Zlib provided via FetchContent. Ideally, I should be able to FetchContent_Declare both Zlib and libzip, and have everything work out of the box without extra setup. **Describe alternatives you've considered** ``` Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) (Required is at least version "1.1.2") ``` Manual workarounds to pass paths, which are fragile and not ideal. **Additional context** On Windows 10, getting `find_package` to work often takes extra effort, so I prefer using `FetchContent` for all dependencies. That way, Zlib can be fetched once and shared across libraries like Protobuf.
关闭于 2025-08-14 1 条评论