From 51227853127e9ed6a6c2a9329f5ca7a3240bbd68 Mon Sep 17 00:00:00 2001 From: Joakim Soderberg Date: Tue, 14 Jan 2014 12:59:48 +0000 Subject: [PATCH] Make it easy to do add_subdirectory from a parent CMake project. --- CMakeLists.txt | 6 ++++++ lib/libwebsockets.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 515938551..6763e4a13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -752,6 +752,7 @@ export(PACKAGE libwebsockets) set(LWS__INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/lib" "${PROJECT_BINARY_DIR}") +set(LIBWEBSOCKETS_INCLUDE_DIRS ${LWS__INCLUDE_DIRS} CACHE PATH "Libwebsockets include directories") configure_file(${PROJECT_SOURCE_DIR}/cmake/LibwebsocketsConfig.cmake.in ${PROJECT_BINARY_DIR}/LibwebsocketsConfig.cmake @ONLY) @@ -849,5 +850,10 @@ message(" LWS_WITH_LATENCY = ${LWS_WITH_LATENCY}") message(" LWS_WITHOUT_DAEMONIZE = ${LWS_WITHOUT_DAEMONIZE}") message("---------------------------------------------------------------------") +# These will be available to parent projects including libwebsockets using add_subdirectory() +set(LIBWEBSOCKETS_LIBRARIES websocket websockets_shared CACHE STRING "Libwebsocket libraries") +set(LIBWEBSOCKETS_LIBRARIES_STATIC websocket CACHE STRING "Libwebsocket static library") +set(LIBWEBSOCKETS_LIBRARIES_SHARED websockets_shared CACHE STRING "Libwebsocket shared library") + # This must always be last! include(CPack) diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 16f294fd2..25e04aba1 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -65,7 +65,9 @@ typedef SSIZE_T ssize_t; #else // NOT WIN32 /* to get ppoll() */ +#ifndef __USE_GNU #define __USE_GNU +#endif #include #include