File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,25 @@ if(@HTTPLIB_IS_USING_BROTLI@)
3939endif ()
4040
4141if (@HTTPLIB_IS_USING_ZSTD@)
42- find_dependency(zstd)
42+ set (httplib_fd_zstd_quiet_arg)
43+ if (${CMAKE_FIND_PACKAGE_NAME} _FIND_QUIETLY)
44+ set (httplib_fd_zstd_quiet_arg QUIET )
45+ endif ()
46+ set (httplib_fd_zstd_required_arg)
47+ if (${CMAKE_FIND_PACKAGE_NAME} _FIND_REQUIRED)
48+ set (httplib_fd_zstd_required_arg REQUIRED)
49+ endif ()
50+ find_package (zstd QUIET )
51+ if (NOT zstd_FOUND)
52+ find_package (PkgConfig ${httplib_fd_zstd_quiet_arg} ${httplib_fd_zstd_required_arg} )
53+ if (PKG_CONFIG_FOUND)
54+ pkg_check_modules(zstd ${httplib_fd_zstd_quiet_arg} ${httplib_fd_zstd_required_arg} IMPORTED_TARGET libzstd)
55+
56+ if (TARGET PkgConfig::zstd)
57+ add_library (zstd::libzstd ALIAS PkgConfig::zstd)
58+ endif ()
59+ endif ()
60+ endif ()
4361 set (httplib_zstd_FOUND ${zstd_FOUND} )
4462endif ()
4563
You can’t perform that action at this time.
0 commit comments