FindLibRHash.cmake 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file LICENSE.rst 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. REQUIRED_VARS LibRHash_LIBRARY LibRHash_INCLUDE_DIR
  43. )
  44. #-----------------------------------------------------------------------------
  45. # Provide documented result variables and targets.
  46. if(LibRHash_FOUND)
  47. set(LibRHash_INCLUDE_DIRS ${LibRHash_INCLUDE_DIR})
  48. set(LibRHash_LIBRARIES ${LibRHash_LIBRARY})
  49. if(NOT TARGET LibRHash::LibRHash)
  50. add_library(LibRHash::LibRHash UNKNOWN IMPORTED)
  51. set_target_properties(LibRHash::LibRHash PROPERTIES
  52. IMPORTED_LOCATION "${LibRHash_LIBRARY}"
  53. INTERFACE_INCLUDE_DIRECTORIES "${LibRHash_INCLUDE_DIRS}"
  54. )
  55. endif()
  56. endif()