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

update find libwebsocket cmake module

This commit is contained in:
Andrew Karpow 2013-11-09 00:34:06 +01:00
parent 6a4e1301a8
commit 25f77b71ce

View File

@ -1,33 +1,35 @@
# This module tries to find libWebsockets library and include files # This module tries to find libWebsockets library and include files
# #
# LIBWEBSOCKETS_FOUND, If false, do not try to use libWebSockets
# LIBWEBSOCKETS_INCLUDE_DIR, path where to find libwebsockets.h # LIBWEBSOCKETS_INCLUDE_DIR, path where to find libwebsockets.h
# LIBWEBSOCKETS_LIBRARY_DIR, path where to find libwebsockets.so # LIBWEBSOCKETS_LIBRARY_DIR, path where to find libwebsockets.so
# LIBWEBSOCKETS_LIBRARIES, the library to link against # LIBWEBSOCKETS_LIBRARIES, the library to link against
# LIBWEBSOCKETS_FOUND, If false, do not try to use libWebSockets
# #
# This currently works probably only for Linux # This currently works probably only for Linux
FIND_PATH ( LIBWEBSOCKETS_INCLUDE_DIR libwebsockets.h find_package(PkgConfig)
/usr/local/include pkg_check_modules(PC_LIBWEBSOCKETS QUIET libwebsockets)
/usr/include set(LIBWEBSOCKETS_DEFINITIONS ${PC_LIBWEBSOCKETS_CFLAGS_OTHER})
find_path(LIBWEBSOCKETS_INCLUDE_DIR libwebsockets.h
HINTS ${PC_LIBWEBSOCKETS_INCLUDEDIR} ${PC_LIBWEBSOCKETS_INCLUDE_DIRS}
) )
FIND_LIBRARY ( LIBWEBSOCKETS_LIBRARIES websockets find_library(LIBWEBSOCKETS_LIBRARY websockets
/usr/local/lib HINTS ${PC_LIBWEBSOCKETS_LIBDIR} ${PC_LIBWEBSOCKETS_LIBRARY_DIRS}
/usr/lib
) )
GET_FILENAME_COMPONENT( LIBWEBSOCKETS_LIBRARY_DIR ${LIBWEBSOCKETS_LIBRARIES} PATH ) set(LIBWEBSOCKETS_LIBRARIES ${LIBWEBSOCKETS_LIBRARY})
set(LIBWEBSOCKETS_INCLUDE_DIRS ${LIBWEBSOCKETS_INCLUDE_DIR})
SET ( LIBWEBSOCKETS_FOUND "NO" ) include(FindPackageHandleStandardArgs)
IF ( LIBWEBSOCKETS_INCLUDE_DIR ) # handle the QUIETLY and REQUIRED arguments and set LIBWEBSOCKETS_FOUND to TRUE
IF ( LIBWEBSOCKETS_LIBRARIES ) # if all listed variables are TRUE
SET ( LIBWEBSOCKETS_FOUND "YES" ) find_package_handle_standard_args(LibWebSockets DEFAULT_MSG
ENDIF ( LIBWEBSOCKETS_LIBRARIES ) LIBWEBSOCKETS_LIBRARY LIBWEBSOCKETS_INCLUDE_DIR
ENDIF ( LIBWEBSOCKETS_INCLUDE_DIR ) )
MARK_AS_ADVANCED( mark_as_advanced(
LIBWEBSOCKETS_LIBRARY_DIR LIBWEBSOCKETS_LIBRARY
LIBWEBSOCKETS_INCLUDE_DIR LIBWEBSOCKETS_INCLUDE_DIR
LIBWEBSOCKETS_LIBRARIES
) )