summaryrefslogtreecommitdiff
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-20 16:41:57 -0400
committerBrad King <brad.king@kitware.com>2023-03-20 16:42:25 -0400
commiteca41c0243003a25d426183aaff90457d2ddb7a3 (patch)
tree812bd3058dff0230fd548fa1b6feb5c36b0d4a67 /Utilities
parente3dc4df9b95272037d27be25ae5ef030ffd83fa4 (diff)
downloadcmake-eca41c0243003a25d426183aaff90457d2ddb7a3.tar.gz
curl: Restore build within CMake after update to 8.0.1
Restore changes from commit 2be5a7de4e (Build: Use imported target `ZLIB::ZLIB` instead of variables, 2022-08-21, v3.25.0-rc1~97^2~10) that were undone by the update to curl 8.0.1. The code was moved.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmcurl/CMakeLists.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index f10a47d111..dcade3d101 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -588,7 +588,7 @@ endif()
set(HAVE_LIBZ OFF)
set(USE_ZLIB OFF)
-optional_dependency(ZLIB)
+find_package(ZLIB)
if(ZLIB_FOUND)
set(HAVE_LIBZ ON)
set(USE_ZLIB ON)
@@ -597,12 +597,16 @@ if(ZLIB_FOUND)
# version of CMake. This allows our dependents to get our dependencies
# transitively.
if(NOT CMAKE_VERSION VERSION_LESS 3.4)
- list(APPEND CURL_LIBS ZLIB::ZLIB)
+ if(CMAKE_USE_SYSTEM_ZLIB)
+ list(APPEND CURL_LIBS ZLIB::ZLIB)
+ else()
+ list(APPEND CURL_LIBS cmzlib)
+ endif()
else()
list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
include_directories(${ZLIB_INCLUDE_DIRS})
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
endif()
- list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
endif()
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)