diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 9f83d4d6..267b62d0 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -63,7 +63,8 @@ jobs: cmake \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ - -DBeast_BUILD_TESTS=ON \ - -DBeast_BUILD_FUZZERS=ON \ + -DBOOST_BEAST_BUILD_EXAMPLES=OFF \ + -DBOOST_BEAST_BUILD_TESTS=ON \ + -DBOOST_BEAST_BUILD_FUZZERS=ON \ -DBOOST_BEAST_FUZZER_CORPUS_PATH=${{ github.workspace }}/corpus.tar .. make boost_beast_fuzz_all diff --git a/CMakeLists.txt b/CMakeLists.txt index 034f7708..850f4689 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,48 +1,8 @@ -if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - -# Generated by `boostdep --cmake beast` -# Copyright 2020, 2021 Peter Dimov -# Distributed under the Boost Software License, Version 1.0. -# https://www.boost.org/LICENSE_1_0.txt - -cmake_minimum_required(VERSION 3.8...3.20) - -project(boost_beast VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) - -add_library(boost_beast INTERFACE) -add_library(Boost::beast ALIAS boost_beast) - -target_include_directories(boost_beast INTERFACE include) - -target_link_libraries(boost_beast - INTERFACE - Boost::asio - Boost::assert - Boost::bind - Boost::config - Boost::container - Boost::core - Boost::endian - Boost::intrusive - Boost::logic - Boost::mp11 - Boost::optional - Boost::smart_ptr - Boost::static_assert - Boost::static_string - Boost::system - Boost::throw_exception - Boost::type_traits - Boost::utility - Boost::winapi -) - -target_compile_features(boost_beast INTERFACE cxx_std_11) - -else() - # -# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) +# Copyright (c) 2021 DMitry Arkhipov (grisumbras@gmail.com) +# Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -50,254 +10,164 @@ else() # Official repository: https://github.com/boostorg/beast # -cmake_minimum_required (VERSION 3.5.1) - -if (POLICY CMP0074) - cmake_policy (SET CMP0074 NEW) -endif() - -#------------------------------------------------------------------------------- - -function (DoGroupSources curdir rootdir folder) - file (GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir} ${PROJECT_SOURCE_DIR}/${curdir}/*) - foreach (child ${children}) - if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child}) - DoGroupSources (${curdir}/${child} ${rootdir} ${folder}) - elseif (${child} STREQUAL "CMakeLists.txt") - source_group("" FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child}) - else() - string (REGEX REPLACE ^${rootdir} ${folder} groupname ${curdir}) - string (REPLACE "/" "\\" groupname ${groupname}) - source_group (${groupname} FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child}) - endif() - endforeach() -endfunction() - -function (GroupSources curdir folder) - DoGroupSources (${curdir} ${curdir} ${folder}) -endfunction() - -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Beast +# Project # -#------------------------------------------------------------------------------- +#------------------------------------------------- +cmake_minimum_required(VERSION 3.8...3.20) +set(BOOST_BEAST_VERSION 356) +if (BOOST_SUPERPROJECT_VERSION) + set(BOOST_BEAST_VERSION ${BOOST_SUPERPROJECT_VERSION}) +endif () +project(boost_beast VERSION "${BOOST_BEAST_VERSION}" LANGUAGES CXX) +set(BOOST_BEAST_IS_ROOT OFF) +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(BOOST_BEAST_IS_ROOT ON) +endif () +set(__ignore__ ${CMAKE_C_COMPILER}) -project (Beast VERSION 356) +#------------------------------------------------- +# +# Options +# +#------------------------------------------------- +if (BOOST_BEAST_IS_ROOT) + include(CTest) +endif () +option(BOOST_BEAST_BUILD_TESTS "Build boost::beast tests" ${BUILD_TESTING}) +option(BOOST_BEAST_BUILD_FUZZERS "Build boost::beast fuzzers" OFF) +option(BOOST_BEAST_BUILD_EXAMPLES "Build boost::beast examples" ${BOOST_BEAST_IS_ROOT}) +option(BOOST_BEAST_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) -set_property (GLOBAL PROPERTY USE_FOLDERS ON) -option (Beast_BUILD_EXAMPLES "Build examples" ON) -option (Beast_BUILD_TESTS "Build tests" ${BUILD_TESTING}) -option (Beast_BUILD_FUZZERS "Build fuzzers" OFF) -option (Beast_ENABLE_HANDLER_TRACKING "Define BOOST_ASIO_ENABLE_HANDLER_TRACKING when building libraries" OFF) -option (Boost_USE_STATIC_LIBS "Use Static Boost libraries" ON) +# Check if environment variable BOOST_SRC_DIR is set +if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR}) + set(DEFAULT_BOOST_SRC_DIR "$ENV{BOOST_SRC_DIR}") +else () + set(DEFAULT_BOOST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") +endif () +set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use when running CMake from this directory") -if (MSVC) - set (CMAKE_VERBOSE_MAKEFILE FALSE) - - add_definitions ( - -D_WIN32_WINNT=0x0601 - -D_SCL_SECURE_NO_WARNINGS=1 - -D_CRT_SECURE_NO_WARNINGS=1 - -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING - -D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING - ) - - add_compile_options( - /bigobj # large object file format - /permissive- # strict C++ - #/wd4503 # decorated name length exceeded, name was truncated - /W4 # enable all warnings - /MP # Multi-processor compilation +#------------------------------------------------- +# +# Boost modules +# +#------------------------------------------------- +# The boost super-project requires one explicit dependency per-line. +set(BOOST_BEAST_DEPENDENCIES + Boost::asio + Boost::assert + Boost::bind + Boost::config + Boost::container + Boost::container_hash + Boost::core + Boost::endian + Boost::intrusive + Boost::logic + Boost::mp11 + Boost::optional + Boost::preprocessor + Boost::smart_ptr + Boost::static_assert + Boost::static_string + Boost::system + Boost::throw_exception + Boost::type_index + Boost::type_traits + Boost::winapi ) - - set (Boost_USE_STATIC_RUNTIME ON) - - set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ob2 /Oi /Ot /GL /MT") - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Oi /Ot /MT") - - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG") - - # for RelWithDebInfo builds, disable incremental linking - # since CMake sets it ON by default for that build type and it - # causes warnings - # - string (REPLACE "/INCREMENTAL" "/INCREMENTAL:NO" replacement_flags - ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}) - set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO ${replacement_flags}) - -else() - set (THREADS_PREFER_PTHREAD_FLAG ON) - find_package (Threads) - link_libraries(Threads::Threads) - - - set( CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wpedantic -Wno-unused-parameter") - - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wrange-loop-analysis") +foreach (BOOST_BEAST_DEPENDENCY ${BOOST_BEAST_DEPENDENCIES}) + if (BOOST_BEAST_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$") + list(APPEND BOOST_BEAST_INCLUDE_LIBRARIES ${CMAKE_MATCH_1}) endif () -endif() +endforeach () +# Conditional dependencies +if (BOOST_BEAST_BUILD_TESTS) + set(BOOST_BEAST_UNIT_TEST_LIBRARIES filesystem) +endif () +if (BOOST_BEAST_BUILD_EXAMPLES) + set(BOOST_BEAST_EXAMPLE_LIBRARIES scope json) +endif () +# Complete dependency list +set(BOOST_INCLUDE_LIBRARIES ${BOOST_BEAST_INCLUDE_LIBRARIES} ${BOOST_BEAST_UNIT_TEST_LIBRARIES} ${BOOST_BEAST_EXAMPLE_LIBRARIES}) +set(BOOST_EXCLUDE_LIBRARIES beast) -# Must come before Boost includes, otherwise the -# IDE sees the wrong file due to boost/ symlinks. -include_directories (include) - -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# OpenSSL +# Add Boost Subdirectory # -#------------------------------------------------------------------------------- +#------------------------------------------------- +if (BOOST_BEAST_IS_ROOT) + set(CMAKE_FOLDER Dependencies) + # Find absolute BOOST_SRC_DIR + if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR}) + set(BOOST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_SRC_DIR}") + endif () -if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR}) - find_program(HOMEBREW brew) - if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND") - execute_process(COMMAND brew --prefix openssl - OUTPUT_VARIABLE OPENSSL_ROOT_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - endif() -endif() + # Validate BOOST_SRC_DIR + set(BOOST_SRC_DIR_IS_VALID ON) + foreach (F "CMakeLists.txt" "Jamroot" "boost-build.jam" "bootstrap.sh" "libs") + if (NOT EXISTS "${BOOST_SRC_DIR}/${F}") + message(STATUS "${BOOST_SRC_DIR}/${F} does not exist. Fallback to find_package.") + set(BOOST_SRC_DIR_IS_VALID OFF) + break() + endif () + endforeach () -find_package(OpenSSL) -if (NOT MSVC) - link_libraries(${OPENSSL_LIBRARIES}) -endif() + # Create Boost interface targets + if (BOOST_SRC_DIR_IS_VALID) + # From BOOST_SRC_DIR + if (BUILD_SHARED_LIBS) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + endif () + set(BOOST_EXCLUDE_LIBRARIES ${PROJECT_NAME}) + set(PREV_BUILD_TESTING ${BUILD_TESTING}) + set(BUILD_TESTING OFF CACHE BOOL "Build the tests." FORCE) + add_subdirectory(${BOOST_SRC_DIR} Dependencies/boost EXCLUDE_FROM_ALL) + set(BUILD_TESTING ${PREV_BUILD_TESTING} CACHE BOOL "Build the tests." FORCE) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${BOOST_SRC_DIR}/tools/cmake/include") + else () + # From Boost Package + find_package(Boost REQUIRED COMPONENTS filesystem scope json) + foreach (BOOST_INCLUDE_LIBRARY ${BOOST_INCLUDE_LIBRARIES}) + if (NOT TARGET Boost::${BOOST_INCLUDE_LIBRARY}) + add_library(Boost::${BOOST_INCLUDE_LIBRARY} ALIAS Boost::headers) + endif () + endforeach () + endif () + unset(CMAKE_FOLDER) +endif () -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Boost +# Library # -#------------------------------------------------------------------------------- +#------------------------------------------------- +add_library(boost_beast INTERFACE) +add_library(Boost::beast ALIAS boost_beast) +target_include_directories(boost_beast INTERFACE include) +target_link_libraries(boost_beast INTERFACE ${BOOST_BEAST_DEPENDENCIES}) +target_compile_features(boost_beast INTERFACE cxx_std_11) +file(GLOB_RECURSE BOOST_BEAST_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost PREFIX "" FILES ${BOOST_BEAST_HEADERS}) +target_sources(boost_beast PRIVATE ${BOOST_BEAST_HEADERS} build.jam) -get_filename_component (BOOST_ROOT ../../ ABSOLUTE) - -# VFALCO I want static but "b2 stage" builds a minimal set which excludes static -add_definitions (-DBOOST_ALL_STATIC_LINK=1) - -add_definitions (-DBOOST_ASIO_NO_DEPRECATED=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_ARRAY=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_BIND=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_DATE_TIME=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_REGEX=1) -add_definitions (-DBOOST_COROUTINES_NO_DEPRECATION_WARNING=1) - -if (MSVC) - include_directories (${BOOST_ROOT}) - link_libraries( bcrypt.lib ) -else() - set(BOOST_INCLUDEDIR ${BOOST_ROOT}) - set(BOOST_LIBRARYDIR ${BOOST_ROOT}/stage/lib) - find_package(Boost COMPONENTS context filesystem system thread REQUIRED) - link_libraries(Boost::context Boost::filesystem Boost::system Boost::thread) -endif() - -link_directories(${BOOST_ROOT}/stage/lib) - -if (MINGW) - link_libraries(ws2_32 mswsock) -endif() - -#------------------------------------------------------------------------------- - -if ("${VARIANT}" STREQUAL "coverage") - if (MSVC) - else() - set (CMAKE_BUILD_TYPE DEBUG) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 --coverage") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") - endif() - -elseif ("${VARIANT}" STREQUAL "ubasan") - if (MSVC) - else() - set (CMAKE_BUILD_TYPE RELWITHDEBINFO) - set (CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -DBOOST_BEAST_NO_SLOW_TESTS=1 -msse4.2 -funsigned-char -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=address,undefined -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/tools/blacklist.supp") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address,undefined -fno-sanitize-recover=address,undefined") - endif() - -elseif ("${VARIANT}" STREQUAL "debug") - set (CMAKE_BUILD_TYPE DEBUG) - -elseif ("${VARIANT}" STREQUAL "release") - set (CMAKE_BUILD_TYPE RELEASE) - -endif() - -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Static Libraries +# Tests # -#------------------------------------------------------------------------------- +#------------------------------------------------- +if (BOOST_BEAST_BUILD_TESTS) + add_subdirectory(test) +endif () -add_definitions (-DBOOST_ASIO_SEPARATE_COMPILATION=1) -add_definitions (-DBOOST_BEAST_SEPARATE_COMPILATION=1) - -GroupSources (test "/") - -add_library ( - lib-asio STATIC - test/lib_asio.cpp -) -if(Beast_ENABLE_HANDLER_TRACKING) - target_compile_definitions(lib-asio - PUBLIC BOOST_ASIO_ENABLE_HANDLER_TRACKING=1) -endif() - -set_property(TARGET lib-asio PROPERTY FOLDER "static-libs") - -add_library ( - lib-asio-ssl STATIC - test/lib_asio_ssl.cpp -) - -set_property(TARGET lib-asio-ssl PROPERTY FOLDER "static-libs") - -add_library ( - lib-beast STATIC - test/lib_beast.cpp -) - -set_property(TARGET lib-beast PROPERTY FOLDER "static-libs") - -target_link_libraries(lib-beast lib-asio) - -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Tests and examples +# Examples # - -include_directories (.) - -if (OPENSSL_FOUND) - include_directories (${OPENSSL_INCLUDE_DIR}) -endif() - -file (GLOB_RECURSE BOOST_BEAST_FILES - ${PROJECT_SOURCE_DIR}/include/boost/beast/*.hpp - ${PROJECT_SOURCE_DIR}/include/boost/beast/*.ipp -) - -file (GLOB_RECURSE BOOST_BEAST_EXPERIMENTAL_FILES - ${PROJECT_SOURCE_DIR}/include/boost/beast/_experimental/*.hpp - ${PROJECT_SOURCE_DIR}/include/boost/beast/_experimental/*.ipp -) - -file (GLOB_RECURSE COMMON_FILES - ${PROJECT_SOURCE_DIR}/example/common/*.hpp - ) - -if (Beast_BUILD_EXAMPLES AND - (NOT "${VARIANT}" STREQUAL "coverage") AND - (NOT "${VARIANT}" STREQUAL "ubasan")) - add_subdirectory (example) -endif() - -if (Beast_BUILD_TESTS) - add_subdirectory (test) -endif() - -endif() +#------------------------------------------------- +if (BOOST_BEAST_BUILD_EXAMPLES) + add_subdirectory(example) +endif () diff --git a/README.md b/README.md index ae5b7838..99311bdc 100644 --- a/README.md +++ b/README.md @@ -198,11 +198,9 @@ CMake may be used to generate a very nice Visual Studio solution and a set of Visual Studio project files using these commands: ``` -cd libs/beast -mkdir bin -cd bin -cmake -G "Visual Studio 17 2022" -A Win32 .. # for 32-bit Windows builds, or -cmake -G "Visual Studio 17 2022" -A x64 .. # for 64-bit Windows builds +cmake -G "Visual Studio 17 2022" -A win32 -B bin -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/boost/libs/beast/cmake/toolchains/msvc.cmake" + +cmake -G "Visual Studio 17 2022" -A x64 -B bin64 -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/boost/libs/beast/cmake/toolchains/msvc.cmake" ``` The files in the repository are laid out thusly: diff --git a/cmake/toolchains/clang.cmake b/cmake/toolchains/clang.cmake new file mode 100644 index 00000000..72dfd3e9 --- /dev/null +++ b/cmake/toolchains/clang.cmake @@ -0,0 +1,5 @@ +# Include gcc options. +include(${CMAKE_CURRENT_LIST_DIR}/gcc.cmake) + +# Compiler options. +add_compile_options(-Wrange-loop-analysis) diff --git a/cmake/toolchains/common.cmake b/cmake/toolchains/common.cmake new file mode 100644 index 00000000..9628d30c --- /dev/null +++ b/cmake/toolchains/common.cmake @@ -0,0 +1,18 @@ +# C++ standard. +set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "") + +# Static library linkage. +set(BUILD_SHARED_LIBS OFF CACHE STRING "") +add_definitions(-DBOOST_ALL_STATIC_LINK=1) + +# Interprocedural optimization. +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "") +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "") +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "") + +# Compiler definitions. +if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS) +endif() + +# Project options. diff --git a/cmake/toolchains/gcc.cmake b/cmake/toolchains/gcc.cmake new file mode 100644 index 00000000..b6a8e1d0 --- /dev/null +++ b/cmake/toolchains/gcc.cmake @@ -0,0 +1,5 @@ +# Include common options. +include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) + +# Compiler options. +add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter) diff --git a/cmake/toolchains/msvc.cmake b/cmake/toolchains/msvc.cmake new file mode 100644 index 00000000..0e6cb581 --- /dev/null +++ b/cmake/toolchains/msvc.cmake @@ -0,0 +1,35 @@ +# Include common options. +include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) + +# Static runtime linkage. +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "") + +# Compiler options. +# Specific to C and CXX, to prevent passing them to MASM +add_compile_options( + $<$:/bigobj> + $<$:/permissive-> + $<$:/W4> + $<$:/MP> +) +if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32") # 32-bit + add_compile_options( + /arch:SSE2 + ) +endif() + +# Linker options. +add_link_options( +) + +# Disable logos. +foreach(lang C CXX ASM_MASM RC) + set(CMAKE_${lang}_FLAGS_INIT "/nologo") +endforeach() +foreach(type EXE SHARED MODULE) + set(CMAKE_${type}_LINKER_FLAGS_INIT "/nologo") +endforeach() + +# Silence Visual Studio CMake integration warnings. +set(SILENCE_VS_DEFINITIONS ${CMAKE_TOOLCHAIN_FILE} ${CMAKE_C_COMPILER}) +set(SILENCE_VS_DEFINITIONS) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 950c29db..8979f264 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -7,8 +7,10 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (advanced) -add_subdirectory (http) -add_subdirectory (websocket) +find_package(OpenSSL) -add_subdirectory (echo-op) +add_subdirectory(advanced) +add_subdirectory(http) +add_subdirectory(websocket) + +add_subdirectory(echo-op) diff --git a/example/advanced/CMakeLists.txt b/example/advanced/CMakeLists.txt index 902020bb..3b6e54cc 100644 --- a/example/advanced/CMakeLists.txt +++ b/example/advanced/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,6 +8,9 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (server) -add_subdirectory (server-flex) -add_subdirectory (server-flex-awaitable) +add_subdirectory(server) + +if (OPENSSL_FOUND) + add_subdirectory(server-flex) + add_subdirectory(server-flex-awaitable) +endif () diff --git a/example/advanced/server-flex-awaitable/CMakeLists.txt b/example/advanced/server-flex-awaitable/CMakeLists.txt index 0ebee130..afeaa40e 100644 --- a/example/advanced/server-flex-awaitable/CMakeLists.txt +++ b/example/advanced/server-flex-awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/advanced/server-flex-awaitable "/") +add_executable(advanced-server-flex-awaitable + Jamfile + advanced_server_flex_awaitable.cpp) - add_executable (advanced-server-flex-awaitable - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - advanced_server_flex_awaitable.cpp - ) +target_include_directories(advanced-server-flex-awaitable + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET advanced-server-flex-awaitable PROPERTY FOLDER "example-advanced-server") - - target_link_libraries (advanced-server-flex-awaitable - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(advanced-server-flex-awaitable + PRIVATE Boost::beast Boost::scope OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(advanced-server-flex-awaitable + PROPERTIES FOLDER "example-advanced-server") diff --git a/example/advanced/server-flex/CMakeLists.txt b/example/advanced/server-flex/CMakeLists.txt index d6075b27..299554ae 100644 --- a/example/advanced/server-flex/CMakeLists.txt +++ b/example/advanced/server-flex/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/advanced/server-flex "/") +add_executable(advanced-server-flex + Jamfile + advanced_server_flex.cpp) - add_executable (advanced-server-flex - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - advanced_server_flex.cpp - ) +target_include_directories(advanced-server-flex + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET advanced-server-flex PROPERTY FOLDER "example-advanced-server") - - target_link_libraries (advanced-server-flex - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(advanced-server-flex + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(advanced-server-flex + PROPERTIES FOLDER "example-advanced-server") diff --git a/example/advanced/server/CMakeLists.txt b/example/advanced/server/CMakeLists.txt index 08014afe..b04a50a1 100644 --- a/example/advanced/server/CMakeLists.txt +++ b/example/advanced/server/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,10 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/advanced/server "/") - -add_executable (advanced-server - ${BOOST_BEAST_FILES} +add_executable(advanced-server Jamfile - advanced_server.cpp -) + advanced_server.cpp) -target_link_libraries(advanced-server - lib-asio - lib-beast) +target_link_libraries(advanced-server PRIVATE Boost::beast) -set_property(TARGET advanced-server PROPERTY FOLDER "example-advanced-server") +set_target_properties(advanced-server PROPERTIES FOLDER "example-advanced-server") diff --git a/example/echo-op/CMakeLists.txt b/example/echo-op/CMakeLists.txt index d0e086b6..4f224ad8 100644 --- a/example/echo-op/CMakeLists.txt +++ b/example/echo-op/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/echo-op "/") - -add_executable (echo-op - ${BOOST_BEAST_FILES} +add_executable(echo-op Jamfile - echo_op.cpp -) + echo_op.cpp) -target_link_libraries(echo-op - lib-asio - lib-beast) +target_link_libraries(echo-op PRIVATE Boost::beast) -set_property(TARGET echo-op PROPERTY FOLDER "example") +set_target_properties(echo-op + PROPERTIES FOLDER "example-echo-op") diff --git a/example/http/CMakeLists.txt b/example/http/CMakeLists.txt index d38604dd..e057d48b 100644 --- a/example/http/CMakeLists.txt +++ b/example/http/CMakeLists.txt @@ -7,5 +7,5 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (client) -add_subdirectory (server) +add_subdirectory(client) +add_subdirectory(server) diff --git a/example/http/client/CMakeLists.txt b/example/http/client/CMakeLists.txt index e052a9b3..ab8fa187 100644 --- a/example/http/client/CMakeLists.txt +++ b/example/http/client/CMakeLists.txt @@ -7,19 +7,18 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (coro) -add_subdirectory (crawl) -add_subdirectory (sync) -add_subdirectory (body) -add_subdirectory (methods) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(body) +add_subdirectory(coro) +add_subdirectory(crawl) +add_subdirectory(methods) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (async-ssl-system-executor) - add_subdirectory (awaitable-ssl) - add_subdirectory (coro-ssl) - add_subdirectory (sync-ssl) -endif() - + add_subdirectory(async-ssl) + add_subdirectory(async-ssl-system-executor) + add_subdirectory(awaitable-ssl) + add_subdirectory(coro-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/http/client/async-ssl-system-executor/CMakeLists.txt b/example/http/client/async-ssl-system-executor/CMakeLists.txt index 049a2fea..1f2f1b23 100644 --- a/example/http/client/async-ssl-system-executor/CMakeLists.txt +++ b/example/http/client/async-ssl-system-executor/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/async-ssl-system-executor "/") +add_executable(http-client-async-ssl-system-executor + Jamfile + http_client_async_ssl_system_executor.cpp) - add_executable (http-client-async-ssl-system-executor - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_async_ssl_system_executor.cpp - ) +target_include_directories(http-client-async-ssl-system-executor + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-client-async-ssl-system-executor PROPERTY FOLDER "example-http-client") +target_link_libraries(http-client-async-ssl-system-executor + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-client-async-ssl-system-executor - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-client-async-ssl-system-executor + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/async-ssl/CMakeLists.txt b/example/http/client/async-ssl/CMakeLists.txt index a64fbf61..23ecde2a 100644 --- a/example/http/client/async-ssl/CMakeLists.txt +++ b/example/http/client/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/async-ssl "/") +add_executable(http-client-async-ssl + Jamfile + http_client_async_ssl.cpp) - add_executable (http-client-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_async_ssl.cpp - ) +target_include_directories(http-client-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-client-async-ssl PROPERTY FOLDER "example-http-client") +target_link_libraries(http-client-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-client-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-client-async-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/async/CMakeLists.txt b/example/http/client/async/CMakeLists.txt index 3847ce61..ad88934f 100644 --- a/example/http/client/async/CMakeLists.txt +++ b/example/http/client/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/async "/") - -add_executable (http-client-async - ${BOOST_BEAST_FILES} +add_executable(http-client-async Jamfile - http_client_async.cpp -) + http_client_async.cpp) -target_link_libraries(http-client-async - lib-asio - lib-beast) +target_link_libraries(http-client-async PRIVATE Boost::beast) -set_property(TARGET http-client-async PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-async + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/awaitable-ssl/CMakeLists.txt b/example/http/client/awaitable-ssl/CMakeLists.txt index fd09f831..0669b7de 100644 --- a/example/http/client/awaitable-ssl/CMakeLists.txt +++ b/example/http/client/awaitable-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,19 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/awaitable "/") - -add_executable (http-client-awaitable-ssl - ${BOOST_BEAST_FILES} +add_executable(http-client-awaitable-ssl Jamfile - http_client_awaitable_ssl.cpp - ) + http_client_awaitable_ssl.cpp) + +target_include_directories(http-client-awaitable-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(http-client-awaitable-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast) + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -set_property(TARGET http-client-awaitable-ssl PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-awaitable-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/awaitable/CMakeLists.txt b/example/http/client/awaitable/CMakeLists.txt index f18d0b94..8f042762 100644 --- a/example/http/client/awaitable/CMakeLists.txt +++ b/example/http/client/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/awaitable "/") - -add_executable (http-client-awaitable - ${BOOST_BEAST_FILES} +add_executable(http-client-awaitable Jamfile - http_client_awaitable.cpp - ) + http_client_awaitable.cpp) -target_link_libraries(http-client-awaitable - lib-asio - lib-beast) +target_link_libraries(http-client-awaitable PRIVATE Boost::beast) -set_property(TARGET http-client-awaitable PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-awaitable + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/body/CMakeLists.txt b/example/http/client/body/CMakeLists.txt index 6709a486..d57d12ee 100644 --- a/example/http/client/body/CMakeLists.txt +++ b/example/http/client/body/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/coro "/") - -add_executable (http-client-json - ${BOOST_BEAST_FILES} +add_executable(http-client-json Jamfile - json_client.cpp - ) + json_client.cpp) -target_link_libraries(http-client-json - lib-asio - lib-beast) +target_link_libraries(http-client-json PRIVATE Boost::beast Boost::json) -set_property(TARGET http-client-json PROPERTY FOLDER "example-json-client") +set_target_properties(http-client-json + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/coro-ssl/CMakeLists.txt b/example/http/client/coro-ssl/CMakeLists.txt index 54fe3ae2..2bcdff42 100644 --- a/example/http/client/coro-ssl/CMakeLists.txt +++ b/example/http/client/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/coro-ssl "/") +add_executable(http-client-coro-ssl + Jamfile + http_client_coro_ssl.cpp) - add_executable (http-client-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_coro_ssl.cpp - ) +target_include_directories(http-client-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-client-coro-ssl PROPERTY FOLDER "example-http-client") +target_link_libraries(http-client-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-client-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-client-coro-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/coro/CMakeLists.txt b/example/http/client/coro/CMakeLists.txt index 1a791ab1..a6236519 100644 --- a/example/http/client/coro/CMakeLists.txt +++ b/example/http/client/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/coro "/") - -add_executable (http-client-coro - ${BOOST_BEAST_FILES} +add_executable(http-client-coro Jamfile - http_client_coro.cpp - ) + http_client_coro.cpp) -target_link_libraries(http-client-coro - lib-asio - lib-beast) +target_link_libraries(http-client-coro PRIVATE Boost::beast) -set_property(TARGET http-client-coro PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-coro + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/crawl/CMakeLists.txt b/example/http/client/crawl/CMakeLists.txt index b502c7d7..788bd44f 100644 --- a/example/http/client/crawl/CMakeLists.txt +++ b/example/http/client/crawl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,20 +8,12 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/crawl "/") - -add_executable (http-crawl - ${BOOST_BEAST_FILES} +add_executable(http-crawl Jamfile - urls_large_data.hpp - urls_large_data.cpp http_crawl.cpp -) + urls_large_data.cpp) -target_link_libraries(http-crawl - lib-asio - lib-beast) - -set_property(TARGET http-crawl PROPERTY FOLDER "example-http-client") +target_link_libraries(http-crawl PRIVATE Boost::beast) +set_target_properties(http-crawl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/methods/CMakeLists.txt b/example/http/client/methods/CMakeLists.txt index cbd5e51b..9345b20f 100644 --- a/example/http/client/methods/CMakeLists.txt +++ b/example/http/client/methods/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/methods "/") - -add_executable (http-client-methods - ${BOOST_BEAST_FILES} +add_executable(http-client-methods Jamfile - http_client_methods.cpp -) + http_client_methods.cpp) -target_link_libraries(http-client-methods - lib-asio - lib-beast) +target_link_libraries(http-client-methods PRIVATE Boost::beast) -set_property(TARGET http-client-methods PROPERTY FOLDER "example-http-client-methods") +set_target_properties(http-client-methods + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/sync-ssl/CMakeLists.txt b/example/http/client/sync-ssl/CMakeLists.txt index 0e0fbea0..a91a4a3d 100644 --- a/example/http/client/sync-ssl/CMakeLists.txt +++ b/example/http/client/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/sync-ssl "/") +add_executable(http-client-sync-ssl + Jamfile + http_client_sync_ssl.cpp) - add_executable (http-client-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_sync_ssl.cpp - ) +target_include_directories(http-client-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-client-sync-ssl PROPERTY FOLDER "example-http-client") +target_link_libraries(http-client-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-client-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-client-sync-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/sync/CMakeLists.txt b/example/http/client/sync/CMakeLists.txt index ea877ec4..195969c7 100644 --- a/example/http/client/sync/CMakeLists.txt +++ b/example/http/client/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/sync "/") - -add_executable (http-client-sync - ${BOOST_BEAST_FILES} +add_executable(http-client-sync Jamfile - http_client_sync.cpp -) + http_client_sync.cpp) -target_link_libraries(http-client-sync - lib-asio - lib-beast) +target_link_libraries(http-client-sync PRIVATE Boost::beast) -set_property(TARGET http-client-sync PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-sync + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/server/CMakeLists.txt b/example/http/server/CMakeLists.txt index 075f8665..90eceb11 100644 --- a/example/http/server/CMakeLists.txt +++ b/example/http/server/CMakeLists.txt @@ -7,18 +7,18 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (coro) -add_subdirectory (fast) -add_subdirectory (small) -add_subdirectory (stackless) -add_subdirectory (sync) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(coro) +add_subdirectory(fast) +add_subdirectory(small) +add_subdirectory(stackless) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (coro-ssl) - add_subdirectory (flex) - add_subdirectory (stackless-ssl) - add_subdirectory (sync-ssl) -endif() + add_subdirectory(async-ssl) + add_subdirectory(coro-ssl) + add_subdirectory(flex) + add_subdirectory(stackless-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/http/server/async-ssl/CMakeLists.txt b/example/http/server/async-ssl/CMakeLists.txt index 4c1e2cd0..029d6eea 100644 --- a/example/http/server/async-ssl/CMakeLists.txt +++ b/example/http/server/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/async-ssl "/") +add_executable(http-server-async-ssl + Jamfile + http_server_async_ssl.cpp) - add_executable (http-server-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_async_ssl.cpp - ) +target_include_directories(http-server-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-server-async-ssl PROPERTY FOLDER "example-http-server") +target_link_libraries(http-server-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-server-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-server-async-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/async/CMakeLists.txt b/example/http/server/async/CMakeLists.txt index b94c0521..05d04374 100644 --- a/example/http/server/async/CMakeLists.txt +++ b/example/http/server/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,18 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/async "/") - -add_executable (http-server-async - ${BOOST_BEAST_FILES} +add_executable(http-server-async Jamfile - http_server_async.cpp -) + http_server_async.cpp) -target_link_libraries(http-server-async - lib-asio - lib-asio-ssl - lib-beast) +target_link_libraries(http-server-async PRIVATE Boost::beast) -set_property(TARGET http-server-async PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-async + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/awaitable/CMakeLists.txt b/example/http/server/awaitable/CMakeLists.txt index 3cfc4808..f9124d11 100644 --- a/example/http/server/awaitable/CMakeLists.txt +++ b/example/http/server/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/awaitable "/") - -add_executable (http-server-awaitable - ${BOOST_BEAST_FILES} +add_executable(http-server-awaitable Jamfile - http_server_awaitable.cpp -) + http_server_awaitable.cpp) -target_link_libraries(http-server-awaitable - lib-asio - lib-beast) +target_link_libraries(http-server-awaitable PRIVATE Boost::beast) -set_property(TARGET http-server-awaitable PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-awaitable + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/coro-ssl/CMakeLists.txt b/example/http/server/coro-ssl/CMakeLists.txt index 9bbf294c..8b816d1f 100644 --- a/example/http/server/coro-ssl/CMakeLists.txt +++ b/example/http/server/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/coro-ssl "/") +add_executable(http-server-coro-ssl + Jamfile + http_server_coro_ssl.cpp) - add_executable (http-server-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_coro_ssl.cpp - ) +target_include_directories(http-server-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-server-coro-ssl PROPERTY FOLDER "example-http-server") +target_link_libraries(http-server-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-server-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-server-coro-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/coro/CMakeLists.txt b/example/http/server/coro/CMakeLists.txt index 6cc8244a..eaab2148 100644 --- a/example/http/server/coro/CMakeLists.txt +++ b/example/http/server/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/coro "/") - -add_executable (http-server-coro - ${BOOST_BEAST_FILES} +add_executable(http-server-coro Jamfile - http_server_coro.cpp -) + http_server_coro.cpp) -target_link_libraries(http-server-coro - lib-asio - lib-beast) +target_link_libraries(http-server-coro PRIVATE Boost::beast) -set_property(TARGET http-server-coro PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-coro + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/fast/CMakeLists.txt b/example/http/server/fast/CMakeLists.txt index ecc8f7bd..06c3cd20 100644 --- a/example/http/server/fast/CMakeLists.txt +++ b/example/http/server/fast/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,20 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/server/fast "/") - -add_executable (http-server-fast - ${BOOST_BEAST_FILES} - ${COMMON_FILES} +add_executable(http-server-fast Jamfile - fields_alloc.hpp - http_server_fast.cpp -) + http_server_fast.cpp) -target_link_libraries(http-server-fast - lib-asio - lib-beast) +target_link_libraries(http-server-fast PRIVATE Boost::beast) -set_property(TARGET http-server-fast PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-fast + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/flex/CMakeLists.txt b/example/http/server/flex/CMakeLists.txt index 0920953b..c490265d 100644 --- a/example/http/server/flex/CMakeLists.txt +++ b/example/http/server/flex/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/flex "/") +add_executable(http-server-flex + Jamfile + http_server_flex.cpp) - add_executable (http-server-flex - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_flex.cpp - ) +target_include_directories(http-server-flex + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-server-flex PROPERTY FOLDER "example-http-server") +target_link_libraries(http-server-flex + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-server-flex - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-server-flex + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/small/CMakeLists.txt b/example/http/server/small/CMakeLists.txt index c443dec5..9d08821b 100644 --- a/example/http/server/small/CMakeLists.txt +++ b/example/http/server/small/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/small "/") - -add_executable (http-server-small - ${BOOST_BEAST_FILES} +add_executable(http-server-small Jamfile - http_server_small.cpp -) + http_server_small.cpp) -target_link_libraries(http-server-small - lib-asio - lib-beast) +target_link_libraries(http-server-small PRIVATE Boost::beast) -set_property(TARGET http-server-small PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-small + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/stackless-ssl/CMakeLists.txt b/example/http/server/stackless-ssl/CMakeLists.txt index f25b9b3d..7a436d28 100644 --- a/example/http/server/stackless-ssl/CMakeLists.txt +++ b/example/http/server/stackless-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/stackless-ssl "/") +add_executable(http-server-stackless-ssl + Jamfile + http_server_stackless_ssl.cpp) - add_executable (http-server-stackless-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_stackless_ssl.cpp - ) +target_include_directories(http-server-stackless-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-server-stackless-ssl PROPERTY FOLDER "example-http-server") +target_link_libraries(http-server-stackless-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (http-server-stackless-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(http-server-stackless-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/stackless/CMakeLists.txt b/example/http/server/stackless/CMakeLists.txt index 1f82d391..e9cb37ed 100644 --- a/example/http/server/stackless/CMakeLists.txt +++ b/example/http/server/stackless/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/stackless "/") - -add_executable (http-server-stackless - ${BOOST_BEAST_FILES} +add_executable(http-server-stackless Jamfile - http_server_stackless.cpp -) + http_server_stackless.cpp) -target_link_libraries(http-server-stackless - lib-asio - lib-beast) +target_link_libraries(http-server-stackless PRIVATE Boost::beast) -set_property(TARGET http-server-stackless PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-stackless + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/sync-ssl/CMakeLists.txt b/example/http/server/sync-ssl/CMakeLists.txt index 4142e2c9..92895cda 100644 --- a/example/http/server/sync-ssl/CMakeLists.txt +++ b/example/http/server/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/sync-ssl "/") +add_executable(http-server-sync-ssl + Jamfile + http_server_sync_ssl.cpp) - add_executable (http-server-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_sync_ssl.cpp - ) +target_include_directories(http-server-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET http-server-sync-ssl PROPERTY FOLDER "example-http-server") - - target_link_libraries (http-server-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-server-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-server-sync-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/sync/CMakeLists.txt b/example/http/server/sync/CMakeLists.txt index 250add77..e0861d1e 100644 --- a/example/http/server/sync/CMakeLists.txt +++ b/example/http/server/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,18 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/sync "/") - -add_executable (http-server-sync - ${BOOST_BEAST_FILES} +add_executable(http-server-sync Jamfile - http_server_sync.cpp -) + http_server_sync.cpp) -target_link_libraries(http-server-sync - lib-asio - lib-asio-ssl - lib-beast) +target_link_libraries(http-server-sync PRIVATE Boost::beast) -set_property(TARGET http-server-sync PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-sync + PROPERTIES FOLDER "example-http-server") diff --git a/example/websocket/CMakeLists.txt b/example/websocket/CMakeLists.txt index d38604dd..e057d48b 100644 --- a/example/websocket/CMakeLists.txt +++ b/example/websocket/CMakeLists.txt @@ -7,5 +7,5 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (client) -add_subdirectory (server) +add_subdirectory(client) +add_subdirectory(server) diff --git a/example/websocket/client/CMakeLists.txt b/example/websocket/client/CMakeLists.txt index 1d09cd03..e925af83 100644 --- a/example/websocket/client/CMakeLists.txt +++ b/example/websocket/client/CMakeLists.txt @@ -7,14 +7,14 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (coro) -add_subdirectory (sync) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(coro) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (async-ssl-system-executor) - add_subdirectory (coro-ssl) - add_subdirectory (sync-ssl) -endif() + add_subdirectory(async-ssl) + add_subdirectory(async-ssl-system-executor) + add_subdirectory(coro-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/websocket/client/async-ssl-system-executor/CMakeLists.txt b/example/websocket/client/async-ssl-system-executor/CMakeLists.txt index 3a22aade..589179f8 100644 --- a/example/websocket/client/async-ssl-system-executor/CMakeLists.txt +++ b/example/websocket/client/async-ssl-system-executor/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/async-ssl-system-executor "/") +add_executable(websocket-client-async-ssl-system-executor + Jamfile + websocket_client_async_ssl_system_executor.cpp) - add_executable (websocket-client-async-ssl-system-executor - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_async_ssl_system_executor.cpp - ) +target_include_directories(websocket-client-async-ssl-system-executor + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-client-async-ssl-system-executor PROPERTY FOLDER "example-websocket-client") +target_link_libraries(websocket-client-async-ssl-system-executor + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-client-async-ssl-system-executor - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-client-async-ssl-system-executor + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/async-ssl/CMakeLists.txt b/example/websocket/client/async-ssl/CMakeLists.txt index a2198280..85286de8 100644 --- a/example/websocket/client/async-ssl/CMakeLists.txt +++ b/example/websocket/client/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/async-ssl "/") +add_executable(websocket-client-async-ssl + Jamfile + websocket_client_async_ssl.cpp) - add_executable (websocket-client-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_async_ssl.cpp - ) +target_include_directories(websocket-client-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-client-async-ssl PROPERTY FOLDER "example-websocket-client") +target_link_libraries(websocket-client-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-client-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-client-async-ssl + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/async/CMakeLists.txt b/example/websocket/client/async/CMakeLists.txt index cc643407..0d84d50e 100644 --- a/example/websocket/client/async/CMakeLists.txt +++ b/example/websocket/client/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/async "/") - -add_executable (websocket-client-async - ${BOOST_BEAST_FILES} +add_executable(websocket-client-async Jamfile - websocket_client_async.cpp -) + websocket_client_async.cpp) -target_link_libraries(websocket-client-async - lib-asio - lib-beast) +target_link_libraries(websocket-client-async PRIVATE Boost::beast) -set_property(TARGET websocket-client-async PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-async + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/awaitable/CMakeLists.txt b/example/websocket/client/awaitable/CMakeLists.txt index b0929f16..fbafe01e 100644 --- a/example/websocket/client/awaitable/CMakeLists.txt +++ b/example/websocket/client/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/awaitable "/") - -add_executable (websocket-client-awaitable - ${BOOST_BEAST_FILES} +add_executable(websocket-client-awaitable Jamfile - websocket_client_awaitable.cpp -) + websocket_client_awaitable.cpp) -target_link_libraries(websocket-client-awaitable - lib-asio - lib-beast) +target_link_libraries(websocket-client-awaitable PRIVATE Boost::beast) -set_property(TARGET websocket-client-awaitable PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-awaitable + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/coro-ssl/CMakeLists.txt b/example/websocket/client/coro-ssl/CMakeLists.txt index fe9db75c..6a7def74 100644 --- a/example/websocket/client/coro-ssl/CMakeLists.txt +++ b/example/websocket/client/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/coro-ssl "/") +add_executable(websocket-client-coro-ssl + Jamfile + websocket_client_coro_ssl.cpp) - add_executable (websocket-client-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_coro_ssl.cpp - ) +target_include_directories(websocket-client-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-client-coro-ssl PROPERTY FOLDER "example-websocket-client") +target_link_libraries(websocket-client-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-client-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-client-coro-ssl + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/coro/CMakeLists.txt b/example/websocket/client/coro/CMakeLists.txt index 2bfeef28..62678d37 100644 --- a/example/websocket/client/coro/CMakeLists.txt +++ b/example/websocket/client/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/coro "/") - -add_executable (websocket-client-coro - ${BOOST_BEAST_FILES} +add_executable(websocket-client-coro Jamfile - websocket_client_coro.cpp -) + websocket_client_coro.cpp) -target_link_libraries(websocket-client-coro - lib-asio - lib-beast) +target_link_libraries(websocket-client-coro PRIVATE Boost::beast) -set_property(TARGET websocket-client-coro PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-coro + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/sync-ssl/CMakeLists.txt b/example/websocket/client/sync-ssl/CMakeLists.txt index b8449570..a59c2320 100644 --- a/example/websocket/client/sync-ssl/CMakeLists.txt +++ b/example/websocket/client/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/sync-ssl "/") +add_executable(websocket-client-sync-ssl + Jamfile + websocket_client_sync_ssl.cpp) - add_executable (websocket-client-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_sync_ssl.cpp - ) +target_include_directories(websocket-client-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-client-sync-ssl PROPERTY FOLDER "example-websocket-client") +target_link_libraries(websocket-client-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-client-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-client-sync-ssl + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/sync/CMakeLists.txt b/example/websocket/client/sync/CMakeLists.txt index d8606ab5..473832bb 100644 --- a/example/websocket/client/sync/CMakeLists.txt +++ b/example/websocket/client/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/sync "/") - -add_executable (websocket-client-sync - ${BOOST_BEAST_FILES} +add_executable(websocket-client-sync Jamfile - websocket_client_sync.cpp -) + websocket_client_sync.cpp) -target_link_libraries(websocket-client-sync - lib-asio - lib-beast) +target_link_libraries(websocket-client-sync PRIVATE Boost::beast) -set_property(TARGET websocket-client-sync PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-sync + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/server/CMakeLists.txt b/example/websocket/server/CMakeLists.txt index 62cb221e..b25017a9 100644 --- a/example/websocket/server/CMakeLists.txt +++ b/example/websocket/server/CMakeLists.txt @@ -7,17 +7,17 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (chat-multi) -add_subdirectory (coro) -add_subdirectory (fast) -add_subdirectory (stackless) -add_subdirectory (sync) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(chat-multi) +add_subdirectory(coro) +add_subdirectory(fast) +add_subdirectory(stackless) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (coro-ssl) - add_subdirectory (stackless-ssl) - add_subdirectory (sync-ssl) -endif() + add_subdirectory(async-ssl) + add_subdirectory(coro-ssl) + add_subdirectory(stackless-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/websocket/server/async-ssl/CMakeLists.txt b/example/websocket/server/async-ssl/CMakeLists.txt index 8f1055d2..70e28478 100644 --- a/example/websocket/server/async-ssl/CMakeLists.txt +++ b/example/websocket/server/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/async-ssl "/") +add_executable(websocket-server-async-ssl + Jamfile + websocket_server_async_ssl.cpp) - add_executable (websocket-server-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_async_ssl.cpp - ) +target_include_directories(websocket-server-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-server-async-ssl PROPERTY FOLDER "example-websocket-server") +target_link_libraries(websocket-server-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-server-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-server-async-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/async/CMakeLists.txt b/example/websocket/server/async/CMakeLists.txt index 0e1ceb8b..0632e469 100644 --- a/example/websocket/server/async/CMakeLists.txt +++ b/example/websocket/server/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/async "/") - -add_executable (websocket-server-async - ${BOOST_BEAST_FILES} +add_executable(websocket-server-async Jamfile - websocket_server_async.cpp -) + websocket_server_async.cpp) -target_link_libraries(websocket-server-async - lib-asio - lib-beast) +target_link_libraries(websocket-server-async PRIVATE Boost::beast) -set_property(TARGET websocket-server-async PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-async + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/awaitable/CMakeLists.txt b/example/websocket/server/awaitable/CMakeLists.txt index 2a99bc82..ecf1d5f2 100644 --- a/example/websocket/server/awaitable/CMakeLists.txt +++ b/example/websocket/server/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/awaitable "/") - -add_executable (websocket-server-awaitable - ${BOOST_BEAST_FILES} +add_executable(websocket-server-awaitable Jamfile - websocket_server_awaitable.cpp -) + websocket_server_awaitable.cpp) -target_link_libraries(websocket-server-awaitable - lib-asio - lib-beast) +target_link_libraries(websocket-server-awaitable PRIVATE Boost::beast) -set_property(TARGET websocket-server-awaitable PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-awaitable + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/chat-multi/CMakeLists.txt b/example/websocket/server/chat-multi/CMakeLists.txt index a256b000..12ce0a7d 100644 --- a/example/websocket/server/chat-multi/CMakeLists.txt +++ b/example/websocket/server/chat-multi/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,35 +8,22 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/chat-multi "/") +add_executable(websocket-chat-multi + beast.hpp + chat_client.html + http_session.cpp + http_session.hpp + Jamfile + listener.cpp + listener.hpp + main.cpp + net.hpp + shared_state.cpp + shared_state.hpp + websocket_session.cpp + websocket_session.hpp) -file (GLOB APP_FILES - beast.hpp - http_session.cpp - http_session.hpp - Jamfile - listener.cpp - listener.hpp - main.cpp - net.hpp - shared_state.cpp - shared_state.hpp - websocket_session.cpp - websocket_session.hpp - chat_client.html - README.md -) +target_link_libraries(websocket-chat-multi PRIVATE Boost::beast) -source_group ("" FILES ${APP_FILES}) - -add_executable (websocket-chat-multi - ${APP_FILES} - ${BOOST_BEAST_FILES} -) - -target_link_libraries(websocket-chat-multi - lib-asio - lib-beast) - -set_property(TARGET websocket-chat-multi PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-chat-multi + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/coro-ssl/CMakeLists.txt b/example/websocket/server/coro-ssl/CMakeLists.txt index a302a2f5..26b283cf 100644 --- a/example/websocket/server/coro-ssl/CMakeLists.txt +++ b/example/websocket/server/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/coro-ssl "/") +add_executable(websocket-server-coro-ssl + Jamfile + websocket_server_coro_ssl.cpp) - add_executable (websocket-server-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_coro_ssl.cpp - ) +target_include_directories(websocket-server-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-server-coro-ssl PROPERTY FOLDER "example-websocket-server") +target_link_libraries(websocket-server-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-server-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-server-coro-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/coro/CMakeLists.txt b/example/websocket/server/coro/CMakeLists.txt index c8e408d1..7e12398b 100644 --- a/example/websocket/server/coro/CMakeLists.txt +++ b/example/websocket/server/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/coro "/") - -add_executable (websocket-server-coro - ${BOOST_BEAST_FILES} +add_executable(websocket-server-coro Jamfile - websocket_server_coro.cpp -) + websocket_server_coro.cpp) -target_link_libraries(websocket-server-coro - lib-asio - lib-beast) +target_link_libraries(websocket-server-coro PRIVATE Boost::beast) -set_property(TARGET websocket-server-coro PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-coro + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/fast/CMakeLists.txt b/example/websocket/server/fast/CMakeLists.txt index 93d469e9..34e663c5 100644 --- a/example/websocket/server/fast/CMakeLists.txt +++ b/example/websocket/server/fast/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/fast "/") - -add_executable (websocket-server-fast - ${BOOST_BEAST_FILES} +add_executable(websocket-server-fast Jamfile - websocket_server_fast.cpp -) + websocket_server_fast.cpp) -target_link_libraries(websocket-server-fast - lib-asio - lib-beast) +target_link_libraries(websocket-server-fast PRIVATE Boost::beast) -set_property(TARGET websocket-server-fast PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-fast + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/stackless-ssl/CMakeLists.txt b/example/websocket/server/stackless-ssl/CMakeLists.txt index 7ae66a07..225f592c 100644 --- a/example/websocket/server/stackless-ssl/CMakeLists.txt +++ b/example/websocket/server/stackless-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/stackless-ssl "/") +add_executable(websocket-server-stackless-ssl + Jamfile + websocket_server_stackless_ssl.cpp) - add_executable (websocket-server-stackless-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_stackless_ssl.cpp - ) +target_include_directories(websocket-server-stackless-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-server-stackless-ssl PROPERTY FOLDER "example-websocket-server") +target_link_libraries(websocket-server-stackless-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-server-stackless-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-server-stackless-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/stackless/CMakeLists.txt b/example/websocket/server/stackless/CMakeLists.txt index b260ca48..4ba04748 100644 --- a/example/websocket/server/stackless/CMakeLists.txt +++ b/example/websocket/server/stackless/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/stackless "/") - -add_executable (websocket-server-stackless - ${BOOST_BEAST_FILES} +add_executable(websocket-server-stackless Jamfile - websocket_server_stackless.cpp -) + websocket_server_stackless.cpp) -target_link_libraries(websocket-server-stackless - lib-asio - lib-beast) +target_link_libraries(websocket-server-stackless PRIVATE Boost::beast) -set_property(TARGET websocket-server-stackless PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-stackless + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/sync-ssl/CMakeLists.txt b/example/websocket/server/sync-ssl/CMakeLists.txt index 0ad254ce..780abcfc 100644 --- a/example/websocket/server/sync-ssl/CMakeLists.txt +++ b/example/websocket/server/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/sync-ssl "/") +add_executable(websocket-server-sync-ssl + Jamfile + websocket_server_sync_ssl.cpp) - add_executable (websocket-server-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_sync_ssl.cpp - ) +target_include_directories(websocket-server-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - set_property(TARGET websocket-server-sync-ssl PROPERTY FOLDER "example-websocket-server") +target_link_libraries(websocket-server-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries (websocket-server-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) - -endif() +set_target_properties(websocket-server-sync-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/sync/CMakeLists.txt b/example/websocket/server/sync/CMakeLists.txt index 48699861..ba5fd5dc 100644 --- a/example/websocket/server/sync/CMakeLists.txt +++ b/example/websocket/server/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/sync "/") - -add_executable (websocket-server-sync - ${BOOST_BEAST_FILES} +add_executable(websocket-server-sync Jamfile - websocket_server_sync.cpp -) + websocket_server_sync.cpp) -target_link_libraries(websocket-server-sync - lib-asio - lib-beast) +target_link_libraries(websocket-server-sync PRIVATE Boost::beast) -set_property(TARGET websocket-server-sync PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-sync + PROPERTIES FOLDER "example-websocket-server") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5cfff564..4ef1e9f0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,70 +8,65 @@ # Official repository: https://github.com/boostorg/beast # -include_directories (./extern) -include_directories (./extras/include) +find_package(OpenSSL) -file (GLOB_RECURSE EXTRAS_FILES - ${PROJECT_SOURCE_DIR}/test/extras/include/*.hpp - ${PROJECT_SOURCE_DIR}/test/extras/include/*.ipp - ${PROJECT_SOURCE_DIR}/test/lib_ssl.cpp - ) +# lib-asio +add_library(lib-asio STATIC lib_asio.cpp) +target_compile_definitions(lib-asio PUBLIC + BOOST_ASIO_SEPARATE_COMPILATION + BOOST_ASIO_NO_DEPRECATED + BOOST_ASIO_DISABLE_BOOST_ARRAY + BOOST_ASIO_DISABLE_BOOST_BIND + BOOST_ASIO_DISABLE_BOOST_DATE_TIME + BOOST_ASIO_DISABLE_BOOST_REGEX) +target_link_libraries(lib-asio PUBLIC Boost::asio) +set_target_properties(lib-asio PROPERTIES FOLDER "static-libs") -if (OPENSSL_FOUND) - link_libraries (${OPENSSL_LIBRARIES}) -endif() +# lib-asio-ssl +add_library(lib-asio-ssl STATIC lib_asio_ssl.cpp) +target_link_libraries(lib-asio-ssl PUBLIC lib-asio) +target_link_libraries(lib-asio-ssl PUBLIC OpenSSL::SSL OpenSSL::Crypto) +set_target_properties(lib-asio-ssl PROPERTIES FOLDER "static-libs") -set (ZLIB_SOURCES - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/crc32.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/deflate.h - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzguts.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inffast.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inffixed.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inflate.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inftrees.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/trees.h - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zconf.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zlib.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zutil.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/adler32.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/compress.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/crc32.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/deflate.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzclose.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzlib.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzread.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzwrite.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/infback.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inffast.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inflate.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inftrees.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/trees.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/uncompr.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zutil.c -) +# lib-beast +add_library(lib-beast STATIC lib_beast.cpp) +target_compile_definitions(lib-beast PUBLIC BOOST_BEAST_SEPARATE_COMPILATION) +target_link_libraries(lib-beast PUBLIC Boost::beast lib-asio) +set_target_properties(lib-beast PROPERTIES FOLDER "static-libs") -add_library ( - lib-zlib - ${ZLIB_SOURCES} -) -target_include_directories(lib-zlib PUBLIC "${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12") -set_property(TARGET lib-zlib PROPERTY FOLDER "static-libs") +# lib-zlib +enable_language(C) +add_library(lib-zlib STATIC + extern/zlib-1.2.12/adler32.c + extern/zlib-1.2.12/compress.c + extern/zlib-1.2.12/crc32.c + extern/zlib-1.2.12/deflate.c + extern/zlib-1.2.12/infback.c + extern/zlib-1.2.12/inffast.c + extern/zlib-1.2.12/inflate.c + extern/zlib-1.2.12/inftrees.c + extern/zlib-1.2.12/trees.c + extern/zlib-1.2.12/uncompr.c + extern/zlib-1.2.12/zutil.c) +target_compile_options(lib-zlib PRIVATE + $<$:-w> + $<$:/wd4127> + $<$:/wd4244> + $<$:/wd4131>) +target_include_directories(lib-zlib PUBLIC extern/zlib-1.2.12) +set_target_properties(lib-zlib PROPERTIES FOLDER "static-libs") -set (TEST_MAIN ${PROJECT_SOURCE_DIR}/test/lib_beast.cpp) +# lib-test +add_library(lib-test STATIC lib_test.cpp) +target_include_directories(lib-test PUBLIC extras/include) +target_link_libraries(lib-test PUBLIC lib-beast) +set_target_properties(lib-test PROPERTIES FOLDER "static-libs") -GroupSources (. "/") +add_subdirectory(beast) +add_subdirectory(bench) +add_subdirectory(doc) +add_subdirectory(example) -add_library ( - lib-test STATIC - ${CMAKE_CURRENT_LIST_DIR}/lib_test.cpp -) - -set_property(TARGET lib-test PROPERTY FOLDER "static-libs") - -add_subdirectory (beast) -add_subdirectory (bench) -add_subdirectory (doc) -add_subdirectory (example) -if (Beast_BUILD_FUZZERS AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +if (BOOST_BEAST_BUILD_FUZZERS AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_subdirectory(fuzz) -endif() +endif () diff --git a/test/beast/CMakeLists.txt b/test/beast/CMakeLists.txt index 72323449..a2966d85 100644 --- a/test/beast/CMakeLists.txt +++ b/test/beast/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,73 +8,28 @@ # Official repository: https://github.com/boostorg/beast # -function(build_individual_tests prefix) - set(options ) - set(oneValueArgs ) - set(multiValueArgs EXCLUDE LIBS EXTRA) - cmake_parse_arguments(bit "${options}" - "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) +add_definitions(-DBOOST_BEAST_ALLOW_DEPRECATED) +add_definitions(-DBOOST_BEAST_TESTS) # For buffers_cat - file(GLOB test_srcs "*.cpp") - set(individual_tests) - foreach(test_src IN LISTS test_srcs) - get_filename_component(test_suffix "${test_src}" NAME_WE) - if(NOT test_suffix IN_LIST bit_EXCLUDE) - set(test_name "${prefix}-${test_suffix}") - add_executable("${test_name}" EXCLUDE_FROM_ALL "${test_src}") - foreach(lib IN LISTS bit_LIBS) - target_link_libraries("${test_name}" "${lib}") - endforeach() - list(APPEND individual_tests COMMAND "${test_name}") - endif() - endforeach() +add_subdirectory(_experimental) +add_subdirectory(core) +add_subdirectory(http) +add_subdirectory(ssl) +add_subdirectory(websocket) +add_subdirectory(zlib) - add_custom_target("${prefix}-all" ${individual_tests}) -endfunction() - -add_definitions (-DBOOST_BEAST_ALLOW_DEPRECATED) - -# For buffers_cat -add_definitions (-DBOOST_BEAST_TESTS) - -add_subdirectory (_experimental) -add_subdirectory (core) -add_subdirectory (http) -add_subdirectory (ssl) -add_subdirectory (websocket) -add_subdirectory (zlib) - -#------------------------------------------------------------------------------- - -GroupSources (include/boost/beast beast) -GroupSources (test/extras/include/boost /) -GroupSources (test/beast /) - -add_executable (tests-beast - ${BOOST_BEAST_FILES} - ${EXTRAS_FILES} +add_executable(tests-beast Jamfile core.cpp http.cpp ssl.cpp version.cpp websocket.cpp - zlib.cpp -) + zlib.cpp) target_link_libraries(tests-beast - lib-asio lib-asio-ssl - lib-beast lib-test) -set_property(TARGET tests-beast PROPERTY FOLDER "tests") - -#add_custom_target(tests-beast-all -# DEPENDS -# tests-beast-_experimental-all -# tests-beast-core-all -# tests-beast-http-all -# tests-beast-ssl-all -# tests-beast-websocket-all -# tests-beast-zlib-all ) +set_target_properties(tests-beast + PROPERTIES FOLDER "tests") diff --git a/test/beast/_experimental/CMakeLists.txt b/test/beast/_experimental/CMakeLists.txt index 34e4dbad..0e57763d 100644 --- a/test/beast/_experimental/CMakeLists.txt +++ b/test/beast/_experimental/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,29 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/_experimental "/") - -add_executable (tests-beast-_experimental - ${BOOST_BEAST_FILES} +add_executable(tests-beast-_experimental Jamfile _test_detail_stream_state.cpp error.cpp icy_stream.cpp - stream.cpp -) + stream.cpp) target_link_libraries(tests-beast-_experimental - lib-asio - lib-beast - lib-test - ) + lib-test) -set_property(TARGET tests-beast-_experimental PROPERTY FOLDER "tests") - -# -# Individual tests -# -#build_individual_tests(tests-beast-_experimental -# EXCLUDE -# LIBS lib-asio lib-asio-ssl lib-beast lib-test) +set_target_properties(tests-beast-_experimental + PROPERTIES FOLDER "tests") diff --git a/test/beast/core/CMakeLists.txt b/test/beast/core/CMakeLists.txt index 51e56dd2..3407b58b 100644 --- a/test/beast/core/CMakeLists.txt +++ b/test/beast/core/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,11 +8,7 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/core "/") - -add_executable (tests-beast-core - ${BOOST_BEAST_FILES} +add_executable(tests-beast-core Jamfile test_buffer.hpp file_test.hpp @@ -64,21 +61,11 @@ add_executable (tests-beast-core static_string.cpp stream_traits.cpp string.cpp - tcp_stream.cpp -) + tcp_stream.cpp) target_link_libraries(tests-beast-core - lib-asio - lib-asio-ssl - lib-beast lib-test - ) + Boost::filesystem) -set_property(TARGET tests-beast-core PROPERTY FOLDER "tests") - -# -# Individual tests -# -#build_individual_tests(tests-beast-core -# EXCLUDE _detail_static_const close_socket zlib make_strand prepare_buffers -# LIBS lib-asio lib-asio-ssl lib-beast lib-test) +set_target_properties(tests-beast-core + PROPERTIES FOLDER "tests") diff --git a/test/beast/http/CMakeLists.txt b/test/beast/http/CMakeLists.txt index d9e1cd88..9931f7e3 100644 --- a/test/beast/http/CMakeLists.txt +++ b/test/beast/http/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,13 +8,7 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extras/include/boost/beast extras) -GroupSources (test/beast/http "/") - add_executable (tests-beast-http - ${BOOST_BEAST_FILES} - ${EXTRAS_FILES} Jamfile any_completion_handler.cpp basic_dynamic_body_fwd.cpp @@ -55,19 +50,11 @@ add_executable (tests-beast-http vector_body_fwd.cpp vector_body.cpp verb.cpp - write.cpp -) + write.cpp) target_link_libraries(tests-beast-http - lib-asio - lib-asio-ssl - lib-beast lib-test - ) + Boost::filesystem) -set_property(TARGET tests-beast-http PROPERTY FOLDER "tests") - -# -# Individual tests -# -#build_individual_tests(tests-beast-http LIBS lib-asio lib-asio-ssl lib-beast lib-test) +set_target_properties(tests-beast-http + PROPERTIES FOLDER "tests") diff --git a/test/beast/ssl/CMakeLists.txt b/test/beast/ssl/CMakeLists.txt index 04f7fa11..5bba3780 100644 --- a/test/beast/ssl/CMakeLists.txt +++ b/test/beast/ssl/CMakeLists.txt @@ -7,22 +7,13 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/ssl "/") - add_executable (tests-beast-ssl - ${BOOST_BEAST_FILES} Jamfile - ssl_stream.cpp -) + ssl_stream.cpp) target_link_libraries(tests-beast-ssl - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) -set_property(TARGET tests-beast-ssl PROPERTY FOLDER "tests") - -#build_individual_tests(tests-beast-ssl LIBS lib-asio lib-asio-ssl lib-beast lib-test) +set_target_properties(tests-beast-ssl + PROPERTIES FOLDER "tests") diff --git a/test/beast/websocket/CMakeLists.txt b/test/beast/websocket/CMakeLists.txt index 3610c9b1..0fbc8150 100644 --- a/test/beast/websocket/CMakeLists.txt +++ b/test/beast/websocket/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,13 +8,7 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extras/include/boost/beast extras) -GroupSources (test/beast/websocket "/") - add_executable (tests-beast-websocket - ${BOOST_BEAST_FILES} - ${EXTRAS_FILES} Jamfile _detail_decorator.cpp _detail_prng.cpp @@ -42,18 +37,11 @@ add_executable (tests-beast-websocket teardown.cpp timer.cpp utf8_checker.cpp - write.cpp -) + write.cpp) target_link_libraries(tests-beast-websocket - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) -set_property(TARGET tests-beast-websocket PROPERTY FOLDER "tests") - -#build_individual_tests(tests-beast-websocket -# EXCLUDE doc_snippets -# LIBS lib-asio lib-asio-ssl lib-beast lib-test) +set_target_properties(tests-beast-websocket + PROPERTIES FOLDER "tests") diff --git a/test/beast/zlib/CMakeLists.txt b/test/beast/zlib/CMakeLists.txt index 26df5289..b330d4c6 100644 --- a/test/beast/zlib/CMakeLists.txt +++ b/test/beast/zlib/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,30 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extern/zlib-1.2.12 zlib) -GroupSources (test/beast/zlib "/") - -if (MSVC) - set_source_files_properties (${ZLIB_SOURCES} PROPERTIES COMPILE_FLAGS "/wd4127 /wd4131 /wd4244") -endif() - add_executable (tests-beast-zlib - ${BOOST_BEAST_FILES} - ${ZLIB_SOURCES} Jamfile error.cpp deflate_stream.cpp inflate_stream.cpp - zlib.cpp -) + zlib.cpp) + +target_include_directories(tests-beast-zlib + PRIVATE ${PROJECT_SOURCE_DIR}/test/extern) target_link_libraries(tests-beast-zlib - lib-asio - lib-beast lib-test - ) + lib-zlib) -set_property(TARGET tests-beast-zlib PROPERTY FOLDER "tests") - -#build_individual_tests(tests-beast-zlib LIBS lib-asio lib-beast lib-test lib-zlib) +set_target_properties(tests-beast-zlib + PROPERTIES FOLDER "tests") diff --git a/test/bench/CMakeLists.txt b/test/bench/CMakeLists.txt index 849f032a..0f589b8e 100644 --- a/test/bench/CMakeLists.txt +++ b/test/bench/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,8 +8,8 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (buffers) -add_subdirectory (parser) -add_subdirectory (utf8_checker) -add_subdirectory (wsload) -add_subdirectory (zlib) +add_subdirectory(buffers) +add_subdirectory(parser) +add_subdirectory(utf8_checker) +add_subdirectory(wsload) +add_subdirectory(zlib) diff --git a/test/bench/buffers/CMakeLists.txt b/test/bench/buffers/CMakeLists.txt index d05db11f..93b2e427 100644 --- a/test/bench/buffers/CMakeLists.txt +++ b/test/bench/buffers/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,19 +8,12 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/bench/buffers "/") - -add_executable (bench-buffers - ${BOOST_BEAST_FILES} +add_executable(bench-buffers Jamfile - bench_buffers.cpp -) + bench_buffers.cpp) target_link_libraries(bench-buffers - lib-asio - lib-beast - lib-test - ) + lib-test) -set_property(TARGET bench-buffers PROPERTY FOLDER "tests-bench") +set_target_properties(bench-buffers + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/parser/CMakeLists.txt b/test/bench/parser/CMakeLists.txt index 4a4eb2ce..29856ecf 100644 --- a/test/bench/parser/CMakeLists.txt +++ b/test/bench/parser/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,23 +8,17 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/http "/") -GroupSources (test/bench/parser "/") - -add_executable (bench-parser - ${BOOST_BEAST_FILES} +add_executable(bench-parser Jamfile - ${PROJECT_SOURCE_DIR}/test/beast/http/message_fuzz.hpp nodejs_parser.hpp nodejs_parser.cpp - bench_parser.cpp -) + bench_parser.cpp) + +target_include_directories(bench-parser + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(bench-parser - lib-asio - lib-beast - lib-test - ) + lib-test) -set_property(TARGET bench-parser PROPERTY FOLDER "tests-bench") +set_target_properties(bench-parser + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/utf8_checker/CMakeLists.txt b/test/bench/utf8_checker/CMakeLists.txt index 6164127a..37147c21 100644 --- a/test/bench/utf8_checker/CMakeLists.txt +++ b/test/bench/utf8_checker/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,19 +8,12 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/bench/utf8_checker "/") - -add_executable (bench-utf8-checker - ${BOOST_BEAST_FILES} +add_executable(bench-utf8-checker Jamfile - bench_utf8_checker.cpp -) + bench_utf8_checker.cpp) target_link_libraries(bench-utf8-checker - lib-asio - lib-beast - lib-test - ) + lib-test) -set_property(TARGET bench-utf8-checker PROPERTY FOLDER "tests-bench") +set_target_properties(bench-utf8-checker + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/wsload/CMakeLists.txt b/test/bench/wsload/CMakeLists.txt index 7a6c5876..52d7e04e 100644 --- a/test/bench/wsload/CMakeLists.txt +++ b/test/bench/wsload/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,18 +8,12 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/bench/wsload "/") - -add_executable (bench-wsload - ${BOOST_BEAST_FILES} +add_executable(bench-wsload Jamfile - wsload.cpp - ) + wsload.cpp) target_link_libraries(bench-wsload - lib-asio - lib-beast - ) + lib-beast) -set_property(TARGET bench-wsload PROPERTY FOLDER "tests-bench") +set_target_properties(bench-wsload + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/zlib/CMakeLists.txt b/test/bench/zlib/CMakeLists.txt index 360f83ed..308433e3 100644 --- a/test/bench/zlib/CMakeLists.txt +++ b/test/bench/zlib/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,17 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extern/zlib-1.2.12 zlib) -GroupSources (test/bench/zlib "/") - -if (MSVC) - set_source_files_properties (${ZLIB_SOURCES} PROPERTIES COMPILE_FLAGS "/wd4127 /wd4131 /wd4244") -endif() - add_executable (bench-zlib - ${BOOST_BEAST_FILES} - ${ZLIB_SOURCES} Jamfile deflate_stream.cpp - inflate_stream.cpp -) -target_link_libraries(bench-zlib - lib-asio - lib-beast - lib-test - ) + inflate_stream.cpp) -set_property(TARGET bench-zlib PROPERTY FOLDER "tests-bench") +target_include_directories(bench-zlib + PRIVATE ${PROJECT_SOURCE_DIR}/test/extern) + +target_link_libraries(bench-zlib + lib-test + lib-zlib) + +set_target_properties(bench-zlib + PROPERTIES FOLDER "tests-bench") diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt new file mode 100644 index 00000000..55a0081f --- /dev/null +++ b/test/cmake_test/CMakeLists.txt @@ -0,0 +1,93 @@ +# +# Copyright (c) 2023 Christian Mazakas +# Copyright (c) 2022 alandefreitas (alandefreitas@gmail.com) +# +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt +# + +cmake_minimum_required(VERSION 3.5...3.16) + +project(cmake_subdir_test LANGUAGES CXX) +set(__ignore__ ${CMAKE_C_COMPILER}) +set(__ignore__ ${CMAKE_C_FLAGS}) + +if(BOOST_CI_INSTALL_TEST) + find_package(Boost CONFIG REQUIRED COMPONENTS beast) +else() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + add_subdirectory(../.. boostorg/beast) + + set(BOOST_URL_BUILD_TESTS OFF CACHE BOOL "" FORCE) + + set(deps + # Primary dependencies + + asio + assert + bind + config + container + container_hash + core + endian + intrusive + logic + mp11 + optional + preprocessor + smart_ptr + static_assert + static_string + system + throw_exception + type_index + type_traits + winapi + + # Secondary dependencies + + align + context + date_time + move + describe + utility + variant2 + predef + pool + algorithm + io + lexical_cast + numeric/conversion + range + tokenizer + array + concept_check + exception + function + iterator + mpl + regex + tuple + unordered + conversion + integer + detail + function_types + fusion + functional + typeof + ) + + foreach(dep IN LISTS deps) + add_subdirectory(../../../${dep} boostorg/${dep} EXCLUDE_FROM_ALL) + endforeach() +endif() + +add_executable(main main.cpp) +target_link_libraries(main Boost::beast) + +enable_testing() +add_test(NAME main COMMAND main) +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_test/main.cpp b/test/cmake_test/main.cpp new file mode 100644 index 00000000..7995ea87 --- /dev/null +++ b/test/cmake_test/main.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + +} diff --git a/test/doc/CMakeLists.txt b/test/doc/CMakeLists.txt index 8d42bfbf..251e40c2 100644 --- a/test/doc/CMakeLists.txt +++ b/test/doc/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,12 +8,7 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (example example) -GroupSources (test/doc "/") - add_executable (tests-doc - ${BOOST_BEAST_FILES} Jamfile snippets.hpp snippets.ipp @@ -33,14 +29,14 @@ add_executable (tests-doc websocket_6_timeouts.cpp websocket_7_teardown.cpp websocket_8_notes.cpp - exemplars.cpp -) + exemplars.cpp) + +target_include_directories(tests-doc + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(tests-doc - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) -set_property(TARGET tests-doc PROPERTY FOLDER "tests") +set_target_properties(tests-doc + PROPERTIES FOLDER "tests") diff --git a/test/example/CMakeLists.txt b/test/example/CMakeLists.txt index 00d48e8e..33320b0d 100644 --- a/test/example/CMakeLists.txt +++ b/test/example/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,4 +8,4 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (common) +add_subdirectory(common) diff --git a/test/example/common/CMakeLists.txt b/test/example/common/CMakeLists.txt index a2c6dfe1..a28426c8 100644 --- a/test/example/common/CMakeLists.txt +++ b/test/example/common/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,17 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (example/common common) -GroupSources (test/extras/include/boost/beast extras) -GroupSources (test/example/common "/") - add_executable (tests-example-common - ${BOOST_BEAST_FILES} - ${COMMON_FILES} - ${EXTRAS_FILES} Jamfile root_certificates.cpp - server_certificate.cpp -) + server_certificate.cpp) + +target_include_directories(tests-example-common + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(tests-example-common - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) -set_property(TARGET tests-example-common PROPERTY FOLDER "tests") \ No newline at end of file +set_target_properties(tests-example-common + PROPERTIES FOLDER "tests") diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt index 99a87d62..c9bd8785 100644 --- a/test/fuzz/CMakeLists.txt +++ b/test/fuzz/CMakeLists.txt @@ -36,7 +36,6 @@ add_custom_target( WORKING_DIRECTORY ${BOOST_BEAST_FUZZER_SEEDS_PARENT_DIR} COMMENT "Unzipping fuzz seeds" VERBATIM) - set(BOOST_BEAST_FUZZER_CORPUS_DIR ${CMAKE_CURRENT_BINARY_DIR}/corpus) set(BOOST_BEAST_FUZZER_MERGED_CORPUS_DIR ${CMAKE_CURRENT_BINARY_DIR}/merged-corpus) if(EXISTS ${BOOST_BEAST_FUZZER_CORPUS_PATH}) @@ -54,6 +53,7 @@ else() COMMENT "Creating fuzz corpus directory" VERBATIM) endif() +set_target_properties(untar_corpus untar_seeds PROPERTIES FOLDER "fuzzing") add_dependencies(untar_corpus untar_seeds) # Target that runs all fuzz targets @@ -64,6 +64,7 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E tar cf ${BOOST_BEAST_FUZZER_CORPUS_PATH} ${BOOST_BEAST_FUZZER_CORPUS_DIR} WORKING_DIRECTORY ${BOOST_BEAST_FUZZER_CORPUS_PARENT_DIR} VERBATIM) + set_target_properties(boost_beast_fuzz_all PROPERTIES FOLDER "fuzzing") # Register a single fuzzer and add as dependency to fuzz target function(add_boost_beast_fuzzer NAME) @@ -73,7 +74,7 @@ function(add_boost_beast_fuzzer NAME) target_link_libraries(fuzzer_${NAME} PRIVATE lib-beast) target_compile_options(fuzzer_${NAME} PRIVATE -g -O2 -fsanitize=fuzzer,address,undefined -fno-sanitize-recover=undefined) target_link_libraries(fuzzer_${NAME} PRIVATE -fsanitize=fuzzer,address,undefined) - set_property(TARGET fuzzer_${NAME} PROPERTY FOLDER "fuzzing") + set_target_properties(fuzzer_${NAME} PROPERTIES FOLDER "fuzzing") # Custom target to run fuzzer executable add_custom_target( @@ -106,7 +107,8 @@ function(add_boost_beast_fuzzer NAME) DEPENDS untar_corpus fuzzer_${NAME}) add_dependencies(fuzz_${NAME} fuzzer_${NAME}) add_dependencies(boost_beast_fuzz_all fuzz_${NAME}) - set_property(TARGET fuzz_${NAME} PROPERTY ENVIRONMENT "UBSAN_OPTIONS=halt_on_error=false") + set_target_properties(fuzz_${NAME} PROPERTIES FOLDER "UBSAN_OPTIONS=halt_on_error=false") + set_target_properties(fuzz_${NAME} PROPERTIES FOLDER "fuzzing") endfunction() # Register all fuzzers