FindMEMCACHED.cmake 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ################################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2014 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 libmemcached library
  17. # Once done this will define
  18. #
  19. # LIBMEMCACHED_FOUND - system has the libmemcached library
  20. # LIBMEMCACHED_INCLUDE_DIR - the libmemcached include directory(s)
  21. # LIBMEMCACHED_LIBRARIES - The libraries needed to use libmemcached
  22. IF (NOT LIBMEMCACHED_FOUND)
  23. IF (WIN32)
  24. SET (libmemcached_lib "libmemcached")
  25. SET (libmemcachedUtil_lib "libmemcachedutil")
  26. ELSE()
  27. SET (libmemcached_lib "memcached")
  28. SET (libmemcachedUtil_lib "memcachedutil")
  29. ENDIF()
  30. FIND_PATH(LIBMEMCACHED_INCLUDE_DIR libmemcached/memcached.hpp PATHS /usr/include /usr/share/include /usr/local/include PATH_SUFFIXES libmemcached)
  31. FIND_LIBRARY (LIBMEMCACHEDCORE_LIBRARY NAMES ${libmemcached_lib} PATHS /usr/lib usr/lib/libmemcached /usr/share /usr/lib64 /usr/local/lib /usr/local/lib64)
  32. FIND_LIBRARY (LIBMEMCACHEDUTIL_LIBRARY NAMES ${libmemcachedUtil_lib} PATHS /usr/lib /usr/share /usr/lib64 /usr/local/lib /usr/local/lib64)
  33. #IF (LIBMEMCACHED_LIBRARY STREQUAL "LIBMEMCACHED_LIBRARY-NOTFOUND")
  34. # SET (LIBMEMCACHEDCORE_LIBRARY "") # Newer versions of libmemcached are header-only, with no associated library.
  35. #ENDIF()
  36. SET (LIBMEMCACHED_LIBRARIES ${LIBMEMCACHEDCORE_LIBRARY} ${LIBMEMCACHEDUTIL_LIBRARY})
  37. include(FindPackageHandleStandardArgs)
  38. find_package_handle_standard_args(memcached DEFAULT_MSG
  39. LIBMEMCACHED_LIBRARIES
  40. LIBMEMCACHED_INCLUDE_DIR
  41. )
  42. MARK_AS_ADVANCED(LIBMEMCACHED_INCLUDE_DIRS LIBMEMCACHED_LIBRARIES)
  43. ENDIF()