FindREDIS.cmake 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ################################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems®.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ################################################################################
  16. # - Try to find the libhiredislibrary
  17. # Once done this will define
  18. #
  19. # LIBHEDIS_FOUND - system has the libhiredis library
  20. # LIBHIREDIS_INCLUDE_DIR - the libhiredis include directory(s)
  21. # LIBHIREDIS_LIBRARY - The library needed to use hiredis
  22. IF (NOT LIBREDIS_FOUND)
  23. IF (WIN32)
  24. SET (libhiredis "libhiredis")
  25. ELSE()
  26. SET (libhiredis "hiredis")
  27. ENDIF()
  28. FIND_PATH(LIBHIREDIS_INCLUDE_DIR hiredis/hiredis.h PATHS /usr/include /usr/share/include /usr/local/include PATH_SUFFIXES hiredis)
  29. FIND_LIBRARY(LIBHIREDIS_LIBRARY NAMES ${libhiredis} PATHS /usr/lib /usr/share /usr/lib64 /usr/local/lib /usr/local/lib64)
  30. include(FindPackageHandleStandardArgs)
  31. find_package_handle_standard_args(redis DEFAULT_MSG
  32. LIBHIREDIS_LIBRARY
  33. LIBHIREDIS_INCLUDE_DIR
  34. )
  35. MARK_AS_ADVANCED(LIBHIREDIS_INCLUDE_DIR LIBHIREDIS_LIBRARY)
  36. ENDIF()