Skip to content

Commit

Permalink
hunter: zstd cmake improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroBurner authored Jan 26, 2024
1 parent 7f8ef03 commit e61c854
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,14 @@ set(HAVE_ZSTD OFF)
if(CURL_ZSTD)
hunter_add_package(zstd)
if(HUNTER_ENABLED)
find_package(zstd REQUIRED)
find_package(zstd CONFIG REQUIRED)
if(Zstd_FOUND AND NOT Zstd_VERSION VERSION_LESS "1.0.0")
set(HAVE_ZSTD ON)
list(APPEND CURL_LIBS zstd::libzstd_static)
if(TARGET zstd::libzstd_static)
list(APPEND CURL_LIBS zstd::libzstd_static)
else()
list(APPEND CURL_LIBS zstd::libzstd_shared)
endif()
include_directories(${ZSTD_INCLUDE_DIRS})
else()
message(WARNING "zstd v1.0.0 or newer is required, disabling zstd support.")
Expand Down

0 comments on commit e61c854

Please sign in to comment.