FindWEBSOCKETS.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #.rst:
  2. # FindWEBSOCKETS
  3. # --------
  4. #
  5. # Find websockets library
  6. #
  7. # ::
  8. #
  9. # WEBSOCKETS_INCLUDE_DIRS, where to find libwebsockets.h.
  10. # WEBSOCKETS_LIBRARIES, the libraries needed to use WEBSOCKETS.
  11. # WEBSOCKETS_FOUND, If false, do not try to use WEBSOCKETS.
  12. #
  13. find_path(WEBSOCKETS_INCLUDE_DIR libwebsockets.h
  14. HINTS ENV WEBSOCKETS_DIR
  15. PATH_SUFFIXES include/websockets include/libwebsockets include
  16. PATHS
  17. ~/Library/Frameworks
  18. /Library/Frameworks
  19. /usr/local
  20. /usr
  21. /sw # Fink
  22. /opt/local # DarwinPorts
  23. /opt/csw # Blastwave
  24. /opt
  25. )
  26. find_library(WEBSOCKETS_LIBRARY NAMES websockets libwebsockets
  27. HINTS ENV WEBSOCKETS_DIR
  28. PATH_SUFFIXES lib
  29. PATHS
  30. ~/Library/Frameworks
  31. /Library/Frameworks
  32. /usr/local
  33. /usr
  34. /sw
  35. /opt/local
  36. /opt/csw
  37. /opt
  38. )
  39. set(WEBSOCKETS_INCLUDE_DIRS ${WEBSOCKETS_INCLUDE_DIR})
  40. set(WEBSOCKETS_LIBRARIES ${WEBSOCKETS_LIBRARY})
  41. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  42. find_package_handle_standard_args(WEBSOCKETS DEFAULT_MSG WEBSOCKETS_LIBRARIES WEBSOCKETS_INCLUDE_DIRS)
  43. mark_as_advanced(WEBSOCKETS_LIBRARIES WEBSOCKETS_INCLUDE_DIRS)