150-zstd-libarchive.patch 696 B

123456789101112131415161718
  1. --- a/Utilities/cmlibarchive/CMakeLists.txt
  2. +++ b/Utilities/cmlibarchive/CMakeLists.txt
  3. @@ -632,8 +632,13 @@ IF(ENABLE_ZSTD)
  4. SET(ZSTD_FIND_QUIETLY TRUE)
  5. ENDIF (ZSTD_INCLUDE_DIR)
  6. - FIND_PATH(ZSTD_INCLUDE_DIR zstd.h)
  7. - FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd libzstd)
  8. + IF(UNIX)
  9. + FIND_PACKAGE(PkgConfig QUIET)
  10. + PKG_SEARCH_MODULE(PC_ZSTD libzstd)
  11. + ENDIF()
  12. +
  13. + FIND_PATH(ZSTD_INCLUDE_DIR zstd.h HINTS ${PC_ZSTD_INCLUDEDIR} ${PC_ZSTD_INCLUDE_DIRS})
  14. + FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd HINTS ${PC_ZSTD_LIBDIR} ${PC_ZSTD_LIBRARY_DIRS})
  15. INCLUDE(FindPackageHandleStandardArgs)
  16. FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR)
  17. ELSE(ENABLE_ZSTD)