From b4ce2ab98d8388fd2f47e8699d12939d52654bd2 Mon Sep 17 00:00:00 2001 From: Jason Lokerson Date: Wed, 20 Aug 2014 11:25:36 -0700 Subject: [PATCH] Squashed 'contrib/websocketpp/' content from commit 71a10d8 git-subtree-dir: contrib/websocketpp git-subtree-split: 71a10d83c8a2a03991fe6121115dc74f187bd836 --- .gitattributes | 18 + .gitignore | 80 + .travis.yml | 22 + CMakeLists.txt | 237 ++ COPYING | 145 ++ Doxyfile | 1874 +++++++++++++++ SConstruct | 248 ++ changelog.md | 160 ++ cmake/CMakeHelpers.cmake | 78 + docs/simple_broadcast_server.cpp | 52 + docs/simple_count_server_thread.cpp | 65 + examples/CMakeLists.txt | 6 + .../associative_storage.cpp | 88 + examples/broadcast_server/SConscript | 23 + .../broadcast_server/broadcast_server.cpp | 159 ++ examples/debug_client/SConscript | 24 + examples/debug_client/debug_client.cpp | 152 ++ examples/debug_server/CMakeLists.txt | 10 + examples/debug_server/SConscript | 23 + examples/debug_server/debug_server.cpp | 92 + examples/dev/SConscript | 18 + examples/dev/main.cpp | 200 ++ examples/echo_server/CMakeLists.txt | 10 + examples/echo_server/SConscript | 23 + examples/echo_server/echo_handler.hpp | 37 + examples/echo_server/echo_server.cpp | 60 + examples/echo_server_both/CMakeLists.txt | 15 + examples/echo_server_both/SConscript | 24 + .../echo_server_both/echo_server_both.cpp | 86 + examples/echo_server_both/server.pem | 58 + examples/echo_server_tls/CMakeLists.txt | 15 + examples/echo_server_tls/SConscript | 24 + examples/echo_server_tls/echo_server_tls.cpp | 72 + examples/echo_server_tls/server.pem | 58 + .../enriched_storage/enriched_storage.cpp | 87 + examples/handler_switch/handler_switch.cpp | 42 + examples/iostream_server/SConscript | 23 + examples/iostream_server/iostream_server.cpp | 93 + examples/print_server/CMakeLists.txt | 10 + examples/print_server/SConscript | 23 + examples/print_server/print_server.cpp | 22 + .../simple_broadcast_server.cpp | 51 + examples/sip_client/CMakeLists.txt | 11 + examples/sip_client/README.txt | 22 + examples/sip_client/SConscript | 23 + examples/sip_client/sip_client.cpp | 88 + examples/subprotocol_server/SConscript | 23 + .../subprotocol_server/subprotocol_server.cpp | 52 + examples/telemetry_client/CMakeLists.txt | 10 + examples/telemetry_client/SConscript | 23 + .../telemetry_client/telemetry_client.cpp | 156 ++ examples/testee_client/CMakeLists.txt | 11 + examples/testee_client/SConscript | 23 + examples/testee_client/testee_client.cpp | 84 + examples/testee_server/SConscript | 23 + examples/testee_server/testee_server.cpp | 142 ++ examples/utility_client/CMakeLists.txt | 11 + examples/utility_client/SConscript | 23 + examples/utility_client/utility_client.cpp | 270 +++ readme.md | 45 + roadmap.md | 44 + test/connection/SConscript | 25 + test/connection/connection.cpp | 241 ++ test/connection/connection_tu2.cpp | 57 + test/connection/connection_tu2.hpp | 50 + test/endpoint/SConscript | 24 + test/endpoint/endpoint.cpp | 101 + test/extension/SConscript | 27 + test/extension/extension.cpp | 37 + test/extension/permessage_deflate.cpp | 543 +++++ test/http/SConscript | 23 + test/http/a.out | Bin 0 -> 120748 bytes test/http/parser.cpp | 968 ++++++++ test/http/parser_perf.cpp | 141 ++ test/http/perf.out | Bin 0 -> 60208 bytes test/http/test.out | Bin 0 -> 1599720 bytes test/logger/SConscript | 23 + test/logger/basic.cpp | 81 + test/message_buffer/SConscript | 27 + test/message_buffer/alloc.cpp | 96 + test/message_buffer/message.cpp | 72 + test/message_buffer/pool.cpp | 156 ++ test/processors/SConscript | 47 + .../extension_permessage_compress.cpp | 198 ++ test/processors/hybi00.cpp | 274 +++ test/processors/hybi07.cpp | 193 ++ test/processors/hybi08.cpp | 197 ++ test/processors/hybi13.cpp | 693 ++++++ test/processors/processor.cpp | 135 ++ test/random/SConscript | 27 + test/random/none.cpp | 40 + test/random/random_device.cpp | 50 + test/roles/SConscript | 27 + test/roles/client.cpp | 194 ++ test/roles/server.cpp | 247 ++ test/transport/SConscript | 24 + test/transport/asio/SConscript | 28 + test/transport/asio/base.cpp | 49 + test/transport/asio/timers.cpp | 187 ++ test/transport/hybi_util.cpp | 98 + test/transport/integration.cpp | 606 +++++ test/transport/iostream/SConscript | 31 + test/transport/iostream/base.cpp | 33 + test/transport/iostream/connection.cpp | 437 ++++ test/transport/iostream/endpoint.cpp | 41 + test/utility/SConscript | 36 + test/utility/close.cpp | 125 + test/utility/frame.cpp | 538 +++++ test/utility/sha1.cpp | 81 + test/utility/uri.cpp | 246 ++ test/utility/utilities.cpp | 73 + .../broadcast_tutorial/broadcast_tutorial.md | 17 + tutorials/chat_tutorial/chat_tutorial.md | 13 + tutorials/utility_client/step1.cpp | 56 + tutorials/utility_client/step2.cpp | 61 + tutorials/utility_client/step3.cpp | 81 + tutorials/utility_client/step4.cpp | 202 ++ tutorials/utility_client/step5.cpp | 280 +++ tutorials/utility_client/utility_client.md | 719 ++++++ websocketpp-config.cmake.in | 7 + websocketpp-configVersion.cmake.in | 11 + websocketpp/CMakeLists.txt | 2 + websocketpp/base64/base64.hpp | 156 ++ websocketpp/client.hpp | 33 + websocketpp/close.hpp | 323 +++ websocketpp/common/chrono.hpp | 55 + websocketpp/common/connection_hdl.hpp | 52 + websocketpp/common/cpp11.hpp | 119 + websocketpp/common/functional.hpp | 66 + websocketpp/common/md5.hpp | 448 ++++ websocketpp/common/memory.hpp | 68 + websocketpp/common/network.hpp | 82 + websocketpp/common/platforms.hpp | 41 + websocketpp/common/random.hpp | 66 + websocketpp/common/regex.hpp | 59 + websocketpp/common/stdint.hpp | 73 + websocketpp/common/system_error.hpp | 66 + websocketpp/common/thread.hpp | 67 + websocketpp/concurrency/basic.hpp | 46 + websocketpp/concurrency/none.hpp | 80 + websocketpp/config/asio.hpp | 77 + websocketpp/config/asio_client.hpp | 77 + websocketpp/config/asio_no_tls.hpp | 73 + websocketpp/config/asio_no_tls_client.hpp | 73 + websocketpp/config/boost_config.hpp | 72 + websocketpp/config/core.hpp | 273 +++ websocketpp/config/core_client.hpp | 282 +++ websocketpp/config/debug.hpp | 274 +++ websocketpp/config/debug_asio.hpp | 77 + websocketpp/config/debug_asio_no_tls.hpp | 73 + websocketpp/config/minimal_client.hpp | 72 + websocketpp/config/minimal_server.hpp | 302 +++ websocketpp/connection.hpp | 1515 ++++++++++++ websocketpp/connection_base.hpp | 38 + websocketpp/endpoint.hpp | 582 +++++ websocketpp/endpoint_base.hpp | 38 + websocketpp/error.hpp | 248 ++ websocketpp/error_container.hpp | 71 + websocketpp/extensions/extension.hpp | 102 + .../permessage_deflate/disabled.hpp | 91 + .../extensions/permessage_deflate/enabled.hpp | 725 ++++++ websocketpp/frame.hpp | 889 +++++++ websocketpp/http/constants.hpp | 303 +++ websocketpp/http/impl/parser.hpp | 171 ++ websocketpp/http/impl/request.hpp | 191 ++ websocketpp/http/impl/response.hpp | 289 +++ websocketpp/http/parser.hpp | 538 +++++ websocketpp/http/request.hpp | 122 + websocketpp/http/response.hpp | 168 ++ websocketpp/impl/connection_impl.hpp | 2118 +++++++++++++++++ websocketpp/impl/endpoint_impl.hpp | 252 ++ websocketpp/impl/utilities_impl.hpp | 84 + websocketpp/logger/basic.hpp | 155 ++ websocketpp/logger/levels.hpp | 192 ++ websocketpp/logger/stub.hpp | 63 + websocketpp/message_buffer/alloc.hpp | 105 + websocketpp/message_buffer/message.hpp | 340 +++ websocketpp/message_buffer/pool.hpp | 229 ++ websocketpp/processors/base.hpp | 294 +++ websocketpp/processors/hybi00.hpp | 393 +++ websocketpp/processors/hybi07.hpp | 67 + websocketpp/processors/hybi08.hpp | 72 + websocketpp/processors/hybi13.hpp | 991 ++++++++ websocketpp/processors/processor.hpp | 397 +++ websocketpp/random/none.hpp | 60 + websocketpp/random/random_device.hpp | 80 + websocketpp/roles/client_endpoint.hpp | 168 ++ websocketpp/roles/server_endpoint.hpp | 166 ++ websocketpp/server.hpp | 33 + websocketpp/sha1/sha1.hpp | 184 ++ websocketpp/transport/asio/base.hpp | 251 ++ websocketpp/transport/asio/connection.hpp | 1125 +++++++++ websocketpp/transport/asio/endpoint.hpp | 1062 +++++++++ websocketpp/transport/asio/security/base.hpp | 152 ++ websocketpp/transport/asio/security/none.hpp | 327 +++ websocketpp/transport/asio/security/tls.hpp | 418 ++++ websocketpp/transport/base/connection.hpp | 237 ++ websocketpp/transport/base/endpoint.hpp | 82 + websocketpp/transport/iostream/base.hpp | 111 + websocketpp/transport/iostream/connection.hpp | 582 +++++ websocketpp/transport/iostream/endpoint.hpp | 173 ++ websocketpp/transport/stub/base.hpp | 95 + websocketpp/transport/stub/connection.hpp | 264 ++ websocketpp/transport/stub/endpoint.hpp | 140 ++ websocketpp/uri.hpp | 354 +++ websocketpp/utf8_validator.hpp | 152 ++ websocketpp/utilities.hpp | 182 ++ websocketpp/version.hpp | 60 + 208 files changed, 36703 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 CMakeLists.txt create mode 100644 COPYING create mode 100644 Doxyfile create mode 100644 SConstruct create mode 100644 changelog.md create mode 100644 cmake/CMakeHelpers.cmake create mode 100644 docs/simple_broadcast_server.cpp create mode 100644 docs/simple_count_server_thread.cpp create mode 100644 examples/CMakeLists.txt create mode 100644 examples/associative_storage/associative_storage.cpp create mode 100644 examples/broadcast_server/SConscript create mode 100644 examples/broadcast_server/broadcast_server.cpp create mode 100644 examples/debug_client/SConscript create mode 100644 examples/debug_client/debug_client.cpp create mode 100644 examples/debug_server/CMakeLists.txt create mode 100644 examples/debug_server/SConscript create mode 100644 examples/debug_server/debug_server.cpp create mode 100644 examples/dev/SConscript create mode 100644 examples/dev/main.cpp create mode 100644 examples/echo_server/CMakeLists.txt create mode 100644 examples/echo_server/SConscript create mode 100644 examples/echo_server/echo_handler.hpp create mode 100644 examples/echo_server/echo_server.cpp create mode 100644 examples/echo_server_both/CMakeLists.txt create mode 100644 examples/echo_server_both/SConscript create mode 100644 examples/echo_server_both/echo_server_both.cpp create mode 100644 examples/echo_server_both/server.pem create mode 100644 examples/echo_server_tls/CMakeLists.txt create mode 100644 examples/echo_server_tls/SConscript create mode 100644 examples/echo_server_tls/echo_server_tls.cpp create mode 100644 examples/echo_server_tls/server.pem create mode 100644 examples/enriched_storage/enriched_storage.cpp create mode 100644 examples/handler_switch/handler_switch.cpp create mode 100644 examples/iostream_server/SConscript create mode 100644 examples/iostream_server/iostream_server.cpp create mode 100644 examples/print_server/CMakeLists.txt create mode 100644 examples/print_server/SConscript create mode 100644 examples/print_server/print_server.cpp create mode 100644 examples/simple_broadcast_server/simple_broadcast_server.cpp create mode 100644 examples/sip_client/CMakeLists.txt create mode 100644 examples/sip_client/README.txt create mode 100644 examples/sip_client/SConscript create mode 100644 examples/sip_client/sip_client.cpp create mode 100644 examples/subprotocol_server/SConscript create mode 100644 examples/subprotocol_server/subprotocol_server.cpp create mode 100644 examples/telemetry_client/CMakeLists.txt create mode 100644 examples/telemetry_client/SConscript create mode 100644 examples/telemetry_client/telemetry_client.cpp create mode 100644 examples/testee_client/CMakeLists.txt create mode 100644 examples/testee_client/SConscript create mode 100644 examples/testee_client/testee_client.cpp create mode 100644 examples/testee_server/SConscript create mode 100644 examples/testee_server/testee_server.cpp create mode 100644 examples/utility_client/CMakeLists.txt create mode 100644 examples/utility_client/SConscript create mode 100644 examples/utility_client/utility_client.cpp create mode 100644 readme.md create mode 100644 roadmap.md create mode 100644 test/connection/SConscript create mode 100644 test/connection/connection.cpp create mode 100644 test/connection/connection_tu2.cpp create mode 100644 test/connection/connection_tu2.hpp create mode 100644 test/endpoint/SConscript create mode 100644 test/endpoint/endpoint.cpp create mode 100644 test/extension/SConscript create mode 100644 test/extension/extension.cpp create mode 100644 test/extension/permessage_deflate.cpp create mode 100644 test/http/SConscript create mode 100755 test/http/a.out create mode 100644 test/http/parser.cpp create mode 100644 test/http/parser_perf.cpp create mode 100755 test/http/perf.out create mode 100755 test/http/test.out create mode 100644 test/logger/SConscript create mode 100644 test/logger/basic.cpp create mode 100644 test/message_buffer/SConscript create mode 100644 test/message_buffer/alloc.cpp create mode 100644 test/message_buffer/message.cpp create mode 100644 test/message_buffer/pool.cpp create mode 100644 test/processors/SConscript create mode 100644 test/processors/extension_permessage_compress.cpp create mode 100644 test/processors/hybi00.cpp create mode 100644 test/processors/hybi07.cpp create mode 100644 test/processors/hybi08.cpp create mode 100644 test/processors/hybi13.cpp create mode 100644 test/processors/processor.cpp create mode 100644 test/random/SConscript create mode 100644 test/random/none.cpp create mode 100644 test/random/random_device.cpp create mode 100644 test/roles/SConscript create mode 100644 test/roles/client.cpp create mode 100644 test/roles/server.cpp create mode 100644 test/transport/SConscript create mode 100644 test/transport/asio/SConscript create mode 100644 test/transport/asio/base.cpp create mode 100644 test/transport/asio/timers.cpp create mode 100644 test/transport/hybi_util.cpp create mode 100644 test/transport/integration.cpp create mode 100644 test/transport/iostream/SConscript create mode 100644 test/transport/iostream/base.cpp create mode 100644 test/transport/iostream/connection.cpp create mode 100644 test/transport/iostream/endpoint.cpp create mode 100644 test/utility/SConscript create mode 100644 test/utility/close.cpp create mode 100644 test/utility/frame.cpp create mode 100644 test/utility/sha1.cpp create mode 100644 test/utility/uri.cpp create mode 100644 test/utility/utilities.cpp create mode 100644 tutorials/broadcast_tutorial/broadcast_tutorial.md create mode 100644 tutorials/chat_tutorial/chat_tutorial.md create mode 100644 tutorials/utility_client/step1.cpp create mode 100644 tutorials/utility_client/step2.cpp create mode 100644 tutorials/utility_client/step3.cpp create mode 100644 tutorials/utility_client/step4.cpp create mode 100644 tutorials/utility_client/step5.cpp create mode 100644 tutorials/utility_client/utility_client.md create mode 100644 websocketpp-config.cmake.in create mode 100644 websocketpp-configVersion.cmake.in create mode 100644 websocketpp/CMakeLists.txt create mode 100644 websocketpp/base64/base64.hpp create mode 100644 websocketpp/client.hpp create mode 100644 websocketpp/close.hpp create mode 100644 websocketpp/common/chrono.hpp create mode 100644 websocketpp/common/connection_hdl.hpp create mode 100644 websocketpp/common/cpp11.hpp create mode 100644 websocketpp/common/functional.hpp create mode 100644 websocketpp/common/md5.hpp create mode 100644 websocketpp/common/memory.hpp create mode 100644 websocketpp/common/network.hpp create mode 100644 websocketpp/common/platforms.hpp create mode 100644 websocketpp/common/random.hpp create mode 100644 websocketpp/common/regex.hpp create mode 100644 websocketpp/common/stdint.hpp create mode 100644 websocketpp/common/system_error.hpp create mode 100644 websocketpp/common/thread.hpp create mode 100644 websocketpp/concurrency/basic.hpp create mode 100644 websocketpp/concurrency/none.hpp create mode 100644 websocketpp/config/asio.hpp create mode 100644 websocketpp/config/asio_client.hpp create mode 100644 websocketpp/config/asio_no_tls.hpp create mode 100644 websocketpp/config/asio_no_tls_client.hpp create mode 100644 websocketpp/config/boost_config.hpp create mode 100644 websocketpp/config/core.hpp create mode 100644 websocketpp/config/core_client.hpp create mode 100644 websocketpp/config/debug.hpp create mode 100644 websocketpp/config/debug_asio.hpp create mode 100644 websocketpp/config/debug_asio_no_tls.hpp create mode 100644 websocketpp/config/minimal_client.hpp create mode 100644 websocketpp/config/minimal_server.hpp create mode 100644 websocketpp/connection.hpp create mode 100644 websocketpp/connection_base.hpp create mode 100644 websocketpp/endpoint.hpp create mode 100644 websocketpp/endpoint_base.hpp create mode 100644 websocketpp/error.hpp create mode 100644 websocketpp/error_container.hpp create mode 100644 websocketpp/extensions/extension.hpp create mode 100644 websocketpp/extensions/permessage_deflate/disabled.hpp create mode 100644 websocketpp/extensions/permessage_deflate/enabled.hpp create mode 100644 websocketpp/frame.hpp create mode 100644 websocketpp/http/constants.hpp create mode 100644 websocketpp/http/impl/parser.hpp create mode 100644 websocketpp/http/impl/request.hpp create mode 100644 websocketpp/http/impl/response.hpp create mode 100644 websocketpp/http/parser.hpp create mode 100644 websocketpp/http/request.hpp create mode 100644 websocketpp/http/response.hpp create mode 100644 websocketpp/impl/connection_impl.hpp create mode 100644 websocketpp/impl/endpoint_impl.hpp create mode 100644 websocketpp/impl/utilities_impl.hpp create mode 100644 websocketpp/logger/basic.hpp create mode 100644 websocketpp/logger/levels.hpp create mode 100644 websocketpp/logger/stub.hpp create mode 100644 websocketpp/message_buffer/alloc.hpp create mode 100644 websocketpp/message_buffer/message.hpp create mode 100644 websocketpp/message_buffer/pool.hpp create mode 100644 websocketpp/processors/base.hpp create mode 100644 websocketpp/processors/hybi00.hpp create mode 100644 websocketpp/processors/hybi07.hpp create mode 100644 websocketpp/processors/hybi08.hpp create mode 100644 websocketpp/processors/hybi13.hpp create mode 100644 websocketpp/processors/processor.hpp create mode 100644 websocketpp/random/none.hpp create mode 100644 websocketpp/random/random_device.hpp create mode 100644 websocketpp/roles/client_endpoint.hpp create mode 100644 websocketpp/roles/server_endpoint.hpp create mode 100644 websocketpp/server.hpp create mode 100755 websocketpp/sha1/sha1.hpp create mode 100644 websocketpp/transport/asio/base.hpp create mode 100644 websocketpp/transport/asio/connection.hpp create mode 100644 websocketpp/transport/asio/endpoint.hpp create mode 100644 websocketpp/transport/asio/security/base.hpp create mode 100644 websocketpp/transport/asio/security/none.hpp create mode 100644 websocketpp/transport/asio/security/tls.hpp create mode 100644 websocketpp/transport/base/connection.hpp create mode 100644 websocketpp/transport/base/endpoint.hpp create mode 100644 websocketpp/transport/iostream/base.hpp create mode 100644 websocketpp/transport/iostream/connection.hpp create mode 100644 websocketpp/transport/iostream/endpoint.hpp create mode 100644 websocketpp/transport/stub/base.hpp create mode 100644 websocketpp/transport/stub/connection.hpp create mode 100644 websocketpp/transport/stub/endpoint.hpp create mode 100644 websocketpp/uri.hpp create mode 100644 websocketpp/utf8_validator.hpp create mode 100644 websocketpp/utilities.hpp create mode 100644 websocketpp/version.hpp diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..a9e4fc784 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +# Lineendings +*.sln eol=crlf +*.vcproj eol=crlf +*.vcxproj* eol=crlf + +# Whitespace rules +# strict (no trailing, no tabs) +*.cpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol +*.hpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol +*.c whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol +*.h whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol + +# normal (no trailing) +*.sql whitespace=trailing-space,space-before-tab,cr-at-eol +*.txt whitespace=trailing-space,space-before-tab,cr-at-eol + +# special files which must ignore whitespace +*.patch whitespace=-trailing-space diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..163832df8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,80 @@ +# make .git* files visible to git +!.gitignore +!.gitattributes + +.DS_Store + +#vim stuff +*~ +*.swp + +*.o +*.so +*.so.? +*.so.?.?.? +*.a +*.dylib +lib/* + +# CMake +*.cmake +*.dir +CMakeFiles +INSTALL.* +ZERO_CHECK.* +CMakeCache.txt +install_manifest.txt + +# Windows/Visual Studio +*.vcproj* +*.sln +*.suo +*.ncb +*/Debug/* +*/*/Debug/* +*/Release/* +*/*/Release/* +*/RelWithDebInfo/* +*/*/RelWithDebInfo/* + +objs_shared/ +objs_static/ + +examples/chat_server/chat_server +examples/echo_server/echo_server +examples/chat_client/chat_client +examples/echo_client/echo_client +test/basic/tests +libwebsocketpp.dylib.0.1.0 + +websocketpp.xcodeproj/xcuserdata/* +websocketpp.xcodeproj/project.xcworkspace/xcuserdata/* +policy_based_notes.hpp + +examples/echo_server_tls/echo_server_tls + +examples/fuzzing_client/fuzzing_client + +examples/stress_client/stress_client + +examples/broadcast_server_tls/broadcast_server + +test/basic/perf + +examples/echo_server_tls/echo_server_tls + +examples/concurrent_server/concurrent_server + +examples/fuzzing_server_tls/fuzzing_server + +examples/wsperf/wsperf + +.sconsign.dblite + +build/ +doxygen/ +examples/wsperf/wsperf_client + +*.out + +*.log diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..bf60651cb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: cpp +compiler: + - gcc +before_install: + - sudo apt-get install libboost-regex1.48-dev libboost-system1.48-dev libboost-thread1.48-dev libboost-test1.48-dev libboost-random1.48-dev -y +env: + global: + - BOOST_INCLUDES=/usr/include + - BOOST_LIBS=/usr/lib +script: scons -j 2 && scons test +branches: + only: + - master + - permessage-deflate + - experimental + - 0.3.x-cmake +notifications: + recipients: + - travis@zaphoyd.com + email: + on_success: change + on_failure: always diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..9ed929f77 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,237 @@ + +############ Setup project and cmake + +# Project name +project (websocketpp) + +# Minimum cmake requirement. We should require a quite recent +# cmake for the dependency find macros etc. to be up to date. +cmake_minimum_required (VERSION 2.6) + +set (WEBSOCKETPP_MAJOR_VERSION 0) +set (WEBSOCKETPP_MINOR_VERSION 4) +set (WEBSOCKETPP_PATCH_VERSION 0) +set (WEBSOCKETPP_VERSION ${WEBSOCKETPP_MAJOR_VERSION}.${WEBSOCKETPP_MINOR_VERSION}.${WEBSOCKETPP_PATCH_VERSION}) + +set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files") +if (WIN32 AND NOT CYGWIN) + set (DEF_INSTALL_CMAKE_DIR cmake) +else () + set (DEF_INSTALL_CMAKE_DIR lib/cmake/websocketpp) +endif () +set (INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") + +# Make relative paths absolute (needed later on) +foreach (p INCLUDE CMAKE) + set (var INSTALL_${p}_DIR) + if (NOT IS_ABSOLUTE "${${var}}") + set (${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") + endif () +endforeach () + +# Set CMake library search policy +if (COMMAND cmake_policy) + cmake_policy (SET CMP0003 NEW) + cmake_policy (SET CMP0005 NEW) +endif () + +# Disable unnecessary build types +set (CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug" CACHE STRING "Configurations" FORCE) + +# Include our cmake macros +set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +include (CMakeHelpers) + +############ Paths + +set (WEBSOCKETPP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) +set (WEBSOCKETPP_INCLUDE ${WEBSOCKETPP_ROOT}/websocketpp) +set (WEBSOCKETPP_BUILD_ROOT ${CMAKE_CURRENT_BINARY_DIR}) +set (WEBSOCKETPP_BIN ${WEBSOCKETPP_BUILD_ROOT}/bin) +set (WEBSOCKETPP_LIB ${WEBSOCKETPP_BUILD_ROOT}/lib) + +# CMake install step prefix. I assume linux users want the prefix to +# be the default /usr or /usr/local so this is only adjusted on Windows. +# - Windows: Build the INSTALL project in your solution file. +# - Linux/OSX: make install. +if (MSVC) + set (CMAKE_INSTALL_PREFIX "${WEBSOCKETPP_ROOT}/install") +endif () + +############ Build customization + +# Override from command line "CMake -D