From 37d6116374de854a126f5cbf2327d2c13630f317 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 23 Nov 2018 08:54:40 +0800 Subject: [PATCH] cmake: copy include/libwebsockets into the build dir https://libwebsockets.org/pipermail/libwebsockets/2018-November/007745.html This allows user code to use the build dir ./include without having to do the make install, as a convenience. --- CMakeLists.txt | 14 ++++++++++++++ READMEs/README.coding.md | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a904d862a..820e4f8f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1278,6 +1278,13 @@ if (LWS_WITH_STATIC) COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets.h ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets.h ) + + add_custom_command( + TARGET websockets + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets/ + ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets + ) + add_custom_command( TARGET websockets COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/lws_config.h @@ -1318,6 +1325,13 @@ if (LWS_WITH_SHARED) COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets.h ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets.h ) + + add_custom_command( + TARGET websockets + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets + ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets + ) + add_custom_command( TARGET websockets_shared COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/lws_config.h diff --git a/READMEs/README.coding.md b/READMEs/README.coding.md index a94e777b8..23f5c97ad 100644 --- a/READMEs/README.coding.md +++ b/READMEs/README.coding.md @@ -305,8 +305,7 @@ Clients with limited storage and RAM will find this useful; the memory needed for the inflate case is constrained so that only one input buffer at a time is ever in memory. -To use this feature, ensure LWS_WITH_ZIP_FOPS is enabled at CMake (it is by -default). +To use this feature, ensure LWS_WITH_ZIP_FOPS is enabled at CMake. `libwebsockets-test-server-v2.0` includes a mount using this technology already, run that test server and navigate to http://localhost:7681/ziptest/candide.html