From 60c53db98c66ec095a8e824ff015128c8a818f75 Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Mon, 22 May 2023 10:46:28 +0200 Subject: [PATCH] Windows: fix handling of .zip files If set(ZLIB_INCLUDE_PATH value) is called without setting cache, and find_package(zlib) is called twice, the second call fails. Behavior described here: https://gitlab.kitware.com/cmake/cmake/-/issues/21343 It seems that the new libcurl version also calls find_package(zlib) so the second call by libarchive fails. And without zlib support handling .zip files that use deflate compression does not work. Only affected Windows, because we are only using a bundled zlib there. On Linux system libarchive and system zlib is used. On Mac OS X bundled libarchive, but system zlib is used. Ref #586 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9ff28f4..170ce7a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -178,7 +178,7 @@ if (WIN32) # Bundled zlib add_subdirectory(dependencies/zlib-1.2.13) set(ZLIB_LIBRARY zlibstatic) - set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib-1.2.13) + set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib-1.2.13 CACHE PATH "zlib include dir") # Bundled libcurl set(CMAKE_CURL_INCLUDES)