File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -620,11 +620,27 @@ endif()
620
620
option (CURL_ZSTD "Set to ON to enable building curl with zstd support." OFF )
621
621
set (HAVE_ZSTD OFF )
622
622
if (CURL_ZSTD )
623
- find_package (Zstd REQUIRED )
623
+ hunter_add_package (zstd )
624
+ if (HUNTER_ENABLED )
625
+ find_package (zstd CONFIG REQUIRED )
626
+ set (Zstd_FOUND "${zstd_FOUND} " )
627
+ set (Zstd_VERSION "${zstd_VERSION} " )
628
+ else ()
629
+ find_package (Zstd REQUIRED )
630
+ endif ()
624
631
if (Zstd_FOUND AND NOT Zstd_VERSION VERSION_LESS "1.0.0" )
625
632
set (HAVE_ZSTD ON )
633
+ if (TARGET zstd::libzstd_static ) # prefer zstd CMake targets
634
+ list (APPEND CURL_LIBS zstd::libzstd_static )
635
+ message (STATUS "found zstd ${Zstd_VERSION} , linking against target zstd::libzstd_static" )
636
+ elseif (TARGET zstd::libzstd_shared )
637
+ list (APPEND CURL_LIBS zstd::libzstd_shared )
638
+ message (STATUS "found zstd ${Zstd_VERSION} , linking against target zstd::libzstd_shared" )
639
+ else () # no indent to keep diffs small
640
+ message (STATUS "found zstd ${Zstd_VERSION} , but no specific cmake target" )
626
641
list (APPEND CURL_LIBS ${Zstd_LIBRARIES} )
627
642
include_directories (${Zstd_INCLUDE_DIRS} )
643
+ endif ()
628
644
else ()
629
645
message (WARNING "zstd v1.0.0 or newer is required, disabling zstd support." )
630
646
endif ()
You can’t perform that action at this time.
0 commit comments