mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:53:39 +03:00
cmake: add support for transitive ZLIB target
This commit is contained in:
parent
5728229a4f
commit
fc0672b447
1 changed files with 10 additions and 2 deletions
|
|
@ -515,8 +515,16 @@ if(CURL_ZLIB)
|
||||||
set(HAVE_ZLIB_H ON)
|
set(HAVE_ZLIB_H ON)
|
||||||
set(HAVE_ZLIB ON)
|
set(HAVE_ZLIB ON)
|
||||||
set(HAVE_LIBZ ON)
|
set(HAVE_LIBZ ON)
|
||||||
list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
|
|
||||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
# Depend on ZLIB via imported targets if supported by the running
|
||||||
|
# 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)
|
||||||
|
else()
|
||||||
|
list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
|
||||||
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue