28 lines
1.2 KiB
Diff
28 lines
1.2 KiB
Diff
# make it link against libwebsockets dynamically
|
|
|
|
--- CMakeLists.txt
|
|
+++ CMakeLists.txt
|
|
@@ -53,21 +53,9 @@
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
find_package(ZLIB REQUIRED)
|
|
-find_package(Libwebsockets 1.7.0 QUIET)
|
|
-
|
|
-if(NOT Libwebsockets_FOUND) # for libwebsockets-dev on ubuntu 16.04
|
|
- find_path(LIBWEBSOCKETS_INCLUDE_DIR NAMES libwebsockets.h)
|
|
- find_library(LIBWEBSOCKETS_LIBRARY NAMES websockets)
|
|
- find_package_handle_standard_args(Libwebsockets REQUIRED_VARS LIBWEBSOCKETS_LIBRARY LIBWEBSOCKETS_INCLUDE_DIR)
|
|
- mark_as_advanced(LIBWEBSOCKETS_INCLUDE_DIR LIBWEBSOCKETS_LIBRARY)
|
|
- if(Libwebsockets_FOUND)
|
|
- SET(LIBWEBSOCKETS_INCLUDE_DIRS "${LIBWEBSOCKETS_INCLUDE_DIR}")
|
|
- SET(LIBWEBSOCKETS_LIBRARIES "${LIBWEBSOCKETS_LIBRARY}")
|
|
- endif()
|
|
-endif()
|
|
|
|
set(INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${LIBWEBSOCKETS_INCLUDE_DIRS} ${JSON-C_INCLUDE_DIRS} ${LIBUV_INCLUDE_DIRS})
|
|
-set(LINK_LIBS ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARIES} ${LIBUV_LIBRARIES})
|
|
+set(LINK_LIBS ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} websockets ${JSON-C_LIBRARIES} ${LIBUV_LIBRARIES})
|
|
|
|
if(WIN32)
|
|
list(APPEND LINK_LIBS shell32)
|