FindZSTD.cmake 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #.rst:
  2. # FindZSTD
  3. # --------------
  4. #
  5. # Find ZSTD library and headers
  6. #
  7. # The module defines the following variables:
  8. #
  9. # ::
  10. #
  11. # ZSTD_FOUND - true if libzstd was found
  12. #
  13. # If library is found, imported target ZSTD::ZSTD is produced to link with.
  14. #
  15. #=============================================================================
  16. # Copyright 2021-2026, Manticore Software LTD (https://manticoresearch.com)
  17. #
  18. # Distributed under the OSI-approved BSD License (the "License");
  19. # see accompanying file Copyright.txt for details.
  20. #
  21. # This software is distributed WITHOUT ANY WARRANTY; without even the
  22. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  23. # See the License for more information.
  24. #=============================================================================
  25. find_path ( ZSTD_INCLUDE_DIRS NAMES "zstd.h" )
  26. find_library ( ZSTD_LINK_LIBRARIES NAMES zstd libzstd NAMES_PER_DIR )
  27. mark_as_advanced ( ZSTD_LINK_LIBRARIES ZSTD_INCLUDE_DIRS )
  28. include ( FindPackageHandleStandardArgs )
  29. find_package_handle_standard_args ( ZSTD REQUIRED_VARS ZSTD_LINK_LIBRARIES )
  30. set_package_properties ( ZSTD PROPERTIES TYPE RUNTIME URL "https://github.com/facebook/zstd" )
  31. include ( helpers )
  32. implib_config ( ZSTD ZSTD::ZSTD )