Skip to content

Commit

Permalink
Windows: fix handling of .zip files
Browse files Browse the repository at this point in the history
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
  • Loading branch information
maxnet committed May 22, 2023
1 parent e490ec1 commit 60c53db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 60c53db

Please # to comment.