Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5768d3a

Browse files
committedJan 19, 2024
Use Hunter to download ZLIB
1 parent 19c18b4 commit 5768d3a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ endif()
583583

584584
set(HAVE_LIBZ OFF)
585585
set(USE_ZLIB OFF)
586+
hunter_add_package(ZLIB)
586587
optional_dependency(ZLIB)
587588
if(ZLIB_FOUND)
588589
set(HAVE_LIBZ ON)
@@ -591,7 +592,10 @@ if(ZLIB_FOUND)
591592
# Depend on ZLIB via imported targets if supported by the running
592593
# version of CMake. This allows our dependents to get our dependencies
593594
# transitively.
594-
if(NOT CMAKE_VERSION VERSION_LESS 3.4)
595+
if(HUNTER_ENABLED)
596+
list(APPEND CURL_LIBS ZLIB::zlib)
597+
set(ZLIB_INCLUDE_DIRS "${ZLIB_ROOT}/include")
598+
elseif(NOT CMAKE_VERSION VERSION_LESS 3.4)
595599
list(APPEND CURL_LIBS ZLIB::ZLIB)
596600
else()
597601
list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})

0 commit comments

Comments
 (0)
Please sign in to comment.