summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt23
1 files changed, 8 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe9f468..822c8fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@ else()
set(CMAKE_C_STANDARD 99)
endif()
-set(SOURCE_FILES src/server.c src/http.c src/protocol.c src/terminal.c src/utils.c)
+set(SOURCE_FILES src/utils.c src/pty.c src/protocol.c src/http.c src/server.c)
include(FindPackageHandleStandardArgs)
@@ -43,7 +43,7 @@ endif()
find_path(JSON-C_INCLUDE_DIR NAMES json.h PATH_SUFFIXES json-c)
find_library(JSON-C_LIBRARY NAMES json-c)
-find_package_handle_standard_args(JSON-C REQUIRED_VARS JSON-C_INCLUDE_DIR JSON-C_LIBRARY)
+find_package_handle_standard_args(JSON-C REQUIRED_VARS JSON-C_LIBRARY JSON-C_INCLUDE_DIR)
mark_as_advanced(JSON-C_INCLUDE_DIR JSON-C_LIBRARY)
if(JSON-C_FOUND)
SET(JSON-C_INCLUDE_DIRS "${JSON-C_INCLUDE_DIR}")
@@ -51,26 +51,19 @@ if(JSON-C_FOUND)
endif()
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()
+find_package(Libwebsockets 3.2.0 REQUIRED)
set(INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} ${LIBWEBSOCKETS_INCLUDE_DIRS} ${JSON-C_INCLUDE_DIRS} ${LIBUV_INCLUDE_DIRS})
set(LINK_LIBS ${ZLIB_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARIES} ${LIBUV_LIBRARIES})
set (CMAKE_REQUIRED_INCLUDES ${INCLUDE_DIRS})
include(CheckSymbolExists)
+check_symbol_exists(LWS_WITH_LIBUV "lws_config.h" LWS_WITH_LIBUV)
check_symbol_exists(LWS_OPENSSL_SUPPORT "lws_config.h" LWS_OPENSSL_ENABLED)
check_symbol_exists(LWS_WITH_MBEDTLS "lws_config.h" LWS_MBEDTLS_ENABLED)
+if(NOT LWS_WITH_LIBUV)
+ message(FATAL_ERROR "libwebsockets was not build with libuv support (-DLWS_WITH_LIBUV=ON)")
+endif()
if(LWS_OPENSSL_ENABLED AND NOT LWS_MBEDTLS_ENABLED)
find_package(OpenSSL REQUIRED)
list(APPEND INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
@@ -78,7 +71,7 @@ if(LWS_OPENSSL_ENABLED AND NOT LWS_MBEDTLS_ENABLED)
endif()
if(WIN32)
- list(APPEND LINK_LIBS shell32)
+ list(APPEND LINK_LIBS shell32 ws2_32)
elseif(NOT APPLE)
list(APPEND LINK_LIBS util)
endif()