FindLibRHash.cmake 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindLibRHash
  5. ------------
  6. Find LibRHash include directory and library.
  7. Imported Targets
  8. ^^^^^^^^^^^^^^^^
  9. An :ref:`imported target <Imported targets>` named
  10. ``LibRHash::LibRHash`` is provided if LibRHash has been found.
  11. Result Variables
  12. ^^^^^^^^^^^^^^^^
  13. This module defines the following variables:
  14. ``LibRHash_FOUND``
  15. True if LibRHash was found, false otherwise.
  16. ``LibRHash_INCLUDE_DIRS``
  17. Include directories needed to include LibRHash headers.
  18. ``LibRHash_LIBRARIES``
  19. Libraries needed to link to LibRHash.
  20. Cache Variables
  21. ^^^^^^^^^^^^^^^
  22. This module uses the following cache variables:
  23. ``LibRHash_LIBRARY``
  24. The location of the LibRHash library file.
  25. ``LibRHash_INCLUDE_DIR``
  26. The location of the LibRHash include directory containing ``rhash.h``.
  27. The cache variables should not be used by project code.
  28. They may be set by end users to point at LibRHash components.
  29. #]=======================================================================]
  30. #-----------------------------------------------------------------------------
  31. find_library(LibRHash_LIBRARY
  32. NAMES rhash
  33. )
  34. mark_as_advanced(LibRHash_LIBRARY)
  35. find_path(LibRHash_INCLUDE_DIR
  36. NAMES rhash.h
  37. )
  38. mark_as_advanced(LibRHash_INCLUDE_DIR)
  39. #-----------------------------------------------------------------------------
  40. include(${CMAKE_CURRENT_LIST_DIR}/../../Modules/FindPackageHandleStandardArgs.cmake)
  41. FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibRHash
  42. FOUND_VAR LibRHash_FOUND
  43. REQUIRED_VARS LibRHash_LIBRARY LibRHash_INCLUDE_DIR
  44. )
  45. set(LIBRHASH_FOUND ${LibRHash_FOUND})
  46. #-----------------------------------------------------------------------------
  47. # Provide documented result variables and targets.
  48. if(LibRHash_FOUND)
  49. set(LibRHash_INCLUDE_DIRS ${LibRHash_INCLUDE_DIR})
  50. set(LibRHash_LIBRARIES ${LibRHash_LIBRARY})
  51. if(NOT TARGET LibRHash::LibRHash)
  52. add_library(LibRHash::LibRHash UNKNOWN IMPORTED)
  53. set_target_properties(LibRHash::LibRHash PROPERTIES
  54. IMPORTED_LOCATION "${LibRHash_LIBRARY}"
  55. INTERFACE_INCLUDE_DIRECTORIES "${LibRHash_INCLUDE_DIRS}"
  56. )
  57. endif()
  58. endif()