1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

minimal: rediscover event loop lib paths

Building the examples may face the same situations as building lws with
the same dependencies, bring over the same CMakeLists.txt approach
This commit is contained in:
Andy Green 2020-03-24 18:59:36 +00:00
parent 9b637c17b9
commit e783a6ca6e

View file

@ -76,13 +76,28 @@ CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defin
if (LWS_WITH_LIBUV)
set(extralibs ${extralibs} uv)
find_path(LIBUV_INCLUDE_DIRS NAMES uv.h)
find_library(LIBUV_LIBRARIES NAMES uv)
message("libuv include dir: ${LIBUV_INCLUDE_DIRS}")
message("libuv libraries: ${LIBUV_LIBRARIES}")
include_directories("${LIBUV_INCLUDE_DIRS}")
set(extralibs ${extralibs} ${LIBUV_LIBRARIES})
endif()
if (LWS_WITH_LIBEVENT)
set(extralibs ${extralibs} event)
find_path(LIBEVENT_INCLUDE_DIRS NAMES event2/event.h)
find_library(LIBEVENT_LIBRARIES NAMES event)
message("libevent include dir: ${LIBEVENT_INCLUDE_DIRS}")
message("libevent libraries: ${LIBEVENT_LIBRARIES}")
include_directories("${LIBEVENT_INCLUDE_DIRS}")
set(extralibs ${extralibs} ${LIBEVENT_LIBRARIES})
endif()
if (LWS_WITH_LIBEV)
set(extralibs ${extralibs} ev)
find_path(LIBEV_INCLUDE_DIRS NAMES ev.h)
find_library(LIBEV_LIBRARIES NAMES ev)
message("libev include dir: ${LIBEV_INCLUDE_DIRS}")
message("libev libraries: ${LIBEV_LIBRARIES}")
include_directories("${LIBEV_INCLUDE_DIRS}")
set(extralibs ${extralibs} ${LIBEV_LIBRARIES})
endif()
if (LWS_WITH_GLIB)
set(LWS_GLIB_INCLUDE_DIRS CACHE PATH "Path to the glib include directory")