1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-11-26 14:57:17 +00:00
ympd/cmake/FindLibWebSockets.cmake

36 lines
1.2 KiB
CMake
Raw Normal View History

2013-11-08 22:32:07 +00:00
# This module tries to find libWebsockets library and include files
#
2013-11-08 23:34:06 +00:00
# LIBWEBSOCKETS_FOUND, If false, do not try to use libWebSockets
2013-11-08 22:32:07 +00:00
# LIBWEBSOCKETS_INCLUDE_DIR, path where to find libwebsockets.h
# LIBWEBSOCKETS_LIBRARY_DIR, path where to find libwebsockets.so
# LIBWEBSOCKETS_LIBRARIES, the library to link against
#
# This currently works probably only for Linux
2013-11-08 23:34:06 +00:00
find_package(PkgConfig)
pkg_check_modules(PC_LIBWEBSOCKETS QUIET libwebsockets)
set(LIBWEBSOCKETS_DEFINITIONS ${PC_LIBWEBSOCKETS_CFLAGS_OTHER})
find_path(LIBWEBSOCKETS_INCLUDE_DIR libwebsockets.h
HINTS ${PC_LIBWEBSOCKETS_INCLUDEDIR} ${PC_LIBWEBSOCKETS_INCLUDE_DIRS}
2013-11-08 22:32:07 +00:00
)
2013-11-08 23:34:06 +00:00
find_library(LIBWEBSOCKETS_LIBRARY websockets
HINTS ${PC_LIBWEBSOCKETS_LIBDIR} ${PC_LIBWEBSOCKETS_LIBRARY_DIRS}
2013-11-08 22:32:07 +00:00
)
2013-11-08 23:34:06 +00:00
set(LIBWEBSOCKETS_LIBRARIES ${LIBWEBSOCKETS_LIBRARY})
set(LIBWEBSOCKETS_INCLUDE_DIRS ${LIBWEBSOCKETS_INCLUDE_DIR})
2013-11-08 22:32:07 +00:00
2013-11-08 23:34:06 +00:00
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBWEBSOCKETS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LibWebSockets DEFAULT_MSG
LIBWEBSOCKETS_LIBRARY LIBWEBSOCKETS_INCLUDE_DIR
)
2013-11-08 22:32:07 +00:00
2013-11-08 23:34:06 +00:00
mark_as_advanced(
LIBWEBSOCKETS_LIBRARY
2013-11-08 22:32:07 +00:00
LIBWEBSOCKETS_INCLUDE_DIR
)