diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2022-08-21 05:02:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-09-22 14:20:30 (GMT) |
commit | 2be5a7de4ea987649dfc1ac669928fecf2613046 (patch) | |
tree | 07a80293018d221034857320e90d43745a183814 /Utilities | |
parent | 14b94f9bf2e8ada7508ae0a248f376746c18d29c (diff) | |
download | CMake-2be5a7de4ea987649dfc1ac669928fecf2613046.zip CMake-2be5a7de4ea987649dfc1ac669928fecf2613046.tar.gz CMake-2be5a7de4ea987649dfc1ac669928fecf2613046.tar.bz2 |
Build: Use imported target `ZLIB::ZLIB` instead of variables
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/cmcurl/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Utilities/cmcurl/lib/content_encoding.c | 2 | ||||
-rw-r--r-- | Utilities/cmcurl/lib/version.c | 2 | ||||
-rw-r--r-- | Utilities/cmlibarchive/CMakeLists.txt | 2 |
4 files changed, 7 insertions, 16 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index b8cf412..9b468c3 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -852,11 +852,11 @@ endif() # Check for symbol dlopen (same as HAVE_LIBDL) check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN) -if(0) # This code not needed for building within CMake. set(HAVE_LIBZ OFF) set(HAVE_ZLIB_H OFF) set(USE_ZLIB OFF) -optional_dependency(ZLIB) +#optional_dependency(ZLIB) +find_package(ZLIB) if(ZLIB_FOUND) set(HAVE_ZLIB_H ON) set(HAVE_LIBZ ON) @@ -870,19 +870,8 @@ if(ZLIB_FOUND) 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() -endif() - -#----------------------------------------------------------------------------- -# CMake-specific curl code. - -if(CURL_SPECIAL_LIBZ) - set(CURL_LIBS ${CURL_LIBS} "${CURL_SPECIAL_LIBZ}") - include_directories(${CURL_SPECIAL_LIBZ_INCLUDES}) - set(HAVE_LIBZ 0) - set(HAVE_ZLIB_H 0) endif() option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF) diff --git a/Utilities/cmcurl/lib/content_encoding.c b/Utilities/cmcurl/lib/content_encoding.c index c03637a..4c723c3 100644 --- a/Utilities/cmcurl/lib/content_encoding.c +++ b/Utilities/cmcurl/lib/content_encoding.c @@ -27,7 +27,7 @@ #include <stddef.h> #ifdef HAVE_ZLIB_H -#include <zlib.h> +#include <cm3p/zlib.h> #endif #ifdef HAVE_BROTLI diff --git a/Utilities/cmcurl/lib/version.c b/Utilities/cmcurl/lib/version.c index e37253d..5e3e428 100644 --- a/Utilities/cmcurl/lib/version.c +++ b/Utilities/cmcurl/lib/version.c @@ -51,7 +51,7 @@ #endif #ifdef HAVE_ZLIB_H -#include <zlib.h> +#include <cm3p/zlib.h> #endif #ifdef HAVE_BROTLI diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index eea472f..b38e653 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -442,6 +442,8 @@ SET(ADDITIONAL_LIBS "") # IF(ENABLE_ZLIB) FIND_PACKAGE(ZLIB) + SET(ZLIB_INCLUDE_DIR "") + SET(ZLIB_LIBRARIES ZLIB::ZLIB) ELSE() SET(ZLIB_FOUND FALSE) # Override cached value ENDIF() |