77# Distributed under the Boost Software License, Version 1.0. (See accompanying
88# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
99#
10- # Official repository: https://github.com/cppalliance/http_io
10+ # Official repository: https://github.com/cppalliance/beast2
1111#
1212
1313#-------------------------------------------------
1616#
1717#-------------------------------------------------
1818cmake_minimum_required (VERSION 3.8...3.20)
19- set (BOOST_HTTP_IO_VERSION 1)
19+ set (BOOST_BEAST2_VERSION 1)
2020if (BOOST_SUPERPROJECT_VERSION)
21- set (BOOST_HTTP_IO_VERSION ${BOOST_SUPERPROJECT_VERSION} )
21+ set (BOOST_BEAST2_VERSION ${BOOST_SUPERPROJECT_VERSION} )
2222endif ()
23- project (boost_http_io VERSION "${BOOST_HTTP_IO_VERSION } " LANGUAGES CXX)
24- set (BOOST_HTTP_IO_IS_ROOT OFF )
23+ project (boost_beast2 VERSION "${BOOST_BEAST2_VERSION } " LANGUAGES CXX)
24+ set (BOOST_BEAST2_IS_ROOT OFF )
2525if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
26- set (BOOST_HTTP_IO_IS_ROOT ON )
26+ set (BOOST_BEAST2_IS_ROOT ON )
2727endif ()
2828set (__ignore__ ${CMAKE_C_COMPILER} )
2929
@@ -32,12 +32,12 @@ set(__ignore__ ${CMAKE_C_COMPILER})
3232# Options
3333#
3434#-------------------------------------------------
35- if (BOOST_HTTP_IO_IS_ROOT )
35+ if (BOOST_BEAST2_IS_ROOT )
3636 include (CTest)
3737endif ()
38- option (BOOST_HTTP_IO_BUILD_TESTS "Build boost::http_io tests" ${BUILD_TESTING} )
39- option (BOOST_HTTP_IO_BUILD_EXAMPLES "Build boost::http_io examples" ${BOOST_HTTP_IO_IS_ROOT } )
40- option (BOOST_HTTP_IO_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF )
38+ option (BOOST_BEAST2_BUILD_TESTS "Build boost::beast2 tests" ${BUILD_TESTING} )
39+ option (BOOST_BEAST2_BUILD_EXAMPLES "Build boost::beast2 examples" ${BOOST_BEAST2_IS_ROOT } )
40+ option (BOOST_BEAST2_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF )
4141
4242
4343# Check if environment variable BOOST_SRC_DIR is set
@@ -54,7 +54,7 @@ set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use
5454#
5555#-------------------------------------------------
5656# The boost super-project requires one explicit dependency per-line.
57- set (BOOST_HTTP_IO_DEPENDENCIES
57+ set (BOOST_BEAST2_DEPENDENCIES
5858 Boost::asio
5959 Boost::assert
6060 Boost::config
@@ -63,28 +63,28 @@ set(BOOST_HTTP_IO_DEPENDENCIES
6363 Boost::throw_exception
6464 )
6565
66- foreach (BOOST_HTTP_IO_DEPENDENCY ${BOOST_HTTP_IO_DEPENDENCIES } )
67- if (BOOST_HTTP_IO_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$" )
68- list (APPEND BOOST_HTTP_IO_INCLUDE_LIBRARIES ${CMAKE_MATCH_1} )
66+ foreach (BOOST_BEAST2_DEPENDENCY ${BOOST_BEAST2_DEPENDENCIES } )
67+ if (BOOST_BEAST2_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$" )
68+ list (APPEND BOOST_BEAST2_INCLUDE_LIBRARIES ${CMAKE_MATCH_1} )
6969 endif ()
7070endforeach ()
7171# Conditional dependencies
72- if (BOOST_HTTP_IO_BUILD_TESTS )
73- set (BOOST_HTTP_IO_UNIT_TEST_LIBRARIES beast url)
72+ if (BOOST_BEAST2_BUILD_TESTS )
73+ set (BOOST_BEAST2_UNIT_TEST_LIBRARIES beast url)
7474endif ()
75- if (BOOST_HTTP_IO_BUILD_EXAMPLES )
76- set (BOOST_HTTP_IO_EXAMPLE_LIBRARIES json program_options scope url multiprecision)
75+ if (BOOST_BEAST2_BUILD_EXAMPLES )
76+ set (BOOST_BEAST2_EXAMPLE_LIBRARIES json program_options scope url multiprecision)
7777endif ()
7878# Complete dependency list
79- set (BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_IO_INCLUDE_LIBRARIES } ${BOOST_HTTP_IO_UNIT_TEST_LIBRARIES } ${BOOST_HTTP_IO_EXAMPLE_LIBRARIES } )
80- set (BOOST_EXCLUDE_LIBRARIES http_io )
79+ set (BOOST_INCLUDE_LIBRARIES ${BOOST_BEAST2_INCLUDE_LIBRARIES } ${BOOST_BEAST2_UNIT_TEST_LIBRARIES } ${BOOST_BEAST2_EXAMPLE_LIBRARIES } )
80+ set (BOOST_EXCLUDE_LIBRARIES beast2 )
8181
8282#-------------------------------------------------
8383#
8484# Add Boost Subdirectory
8585#
8686#-------------------------------------------------
87- if (BOOST_HTTP_IO_IS_ROOT )
87+ if (BOOST_BEAST2_IS_ROOT )
8888 set (CMAKE_FOLDER Dependencies)
8989 # Find absolute BOOST_SRC_DIR
9090 if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR} )
@@ -132,50 +132,50 @@ endif ()
132132#-------------------------------------------------
133133set_property (GLOBAL PROPERTY USE_FOLDERS ON )
134134
135- file (GLOB_RECURSE BOOST_HTTP_IO_HEADERS CONFIGURE_DEPENDS include /boost/http_io /*.hpp include /boost/*.natvis)
136- file (GLOB_RECURSE BOOST_HTTP_IO_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)
135+ file (GLOB_RECURSE BOOST_BEAST2_HEADERS CONFIGURE_DEPENDS include /boost/beast2 /*.hpp include /boost/*.natvis)
136+ file (GLOB_RECURSE BOOST_BEAST2_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)
137137
138- source_group ("" FILES "include/boost/http_io .hpp" "build/Jamfile" )
139- source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /include /boost/http_io PREFIX "include" FILES ${BOOST_HTTP_IO_HEADERS } )
140- source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /src PREFIX "src" FILES ${BOOST_HTTP_IO_SOURCES } )
138+ source_group ("" FILES "include/boost/beast2 .hpp" "build/Jamfile" )
139+ source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /include /boost/beast2 PREFIX "include" FILES ${BOOST_BEAST2_HEADERS } )
140+ source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /src PREFIX "src" FILES ${BOOST_BEAST2_SOURCES } )
141141
142142
143- function (boost_http_io_setup_properties target )
143+ function (boost_beast2_setup_properties target )
144144 target_compile_features (${target} PUBLIC cxx_constexpr)
145145 target_include_directories (${target} PUBLIC "${PROJECT_SOURCE_DIR} /include" )
146- target_link_libraries (${target} PUBLIC ${BOOST_HTTP_IO_DEPENDENCIES } )
146+ target_link_libraries (${target} PUBLIC ${BOOST_BEAST2_DEPENDENCIES } )
147147 find_package (Threads REQUIRED)
148148 target_link_libraries (${target} PUBLIC Threads::Threads)
149149 if (MINGW)
150150 target_link_libraries (${target} PUBLIC ws2_32 wsock32)
151151 endif ()
152- target_compile_definitions (${target} PUBLIC BOOST_HTTP_IO_NO_LIB )
153- target_compile_definitions (${target} PRIVATE BOOST_HTTP_IO_SOURCE )
152+ target_compile_definitions (${target} PUBLIC BOOST_BEAST2_NO_LIB )
153+ target_compile_definitions (${target} PRIVATE BOOST_BEAST2_SOURCE )
154154 if (BUILD_SHARED_LIBS )
155- target_compile_definitions (${target} PUBLIC BOOST_HTTP_IO_DYN_LINK )
155+ target_compile_definitions (${target} PUBLIC BOOST_BEAST2_DYN_LINK )
156156 else ()
157- target_compile_definitions (${target} PUBLIC BOOST_HTTP_IO_STATIC_LINK )
157+ target_compile_definitions (${target} PUBLIC BOOST_BEAST2_STATIC_LINK )
158158 endif ()
159159endfunction ()
160160
161- if (BOOST_HTTP_IO_MRDOCS_BUILD )
162- file (WRITE "${CMAKE_CURRENT_BINARY_DIR} /mrdocs.cpp" "#include <boost/http_io .hpp>\n " )
163- add_library (boost_http_io_mrdocs "${CMAKE_CURRENT_BINARY_DIR} /mrdocs.cpp" )
164- boost_http_io_setup_properties(boost_http_io_mrdocs )
165- boost_http_io_setup_properties(boost_http_io_mrdocs PUBLIC BOOST_HTTP_IO_MRDOCS )
161+ if (BOOST_BEAST2_MRDOCS_BUILD )
162+ file (WRITE "${CMAKE_CURRENT_BINARY_DIR} /mrdocs.cpp" "#include <boost/beast2 .hpp>\n " )
163+ add_library (boost_beast2_mrdocs "${CMAKE_CURRENT_BINARY_DIR} /mrdocs.cpp" )
164+ boost_beast2_setup_properties(boost_beast2_mrdocs )
165+ boost_beast2_setup_properties(boost_beast2_mrdocs PUBLIC BOOST_BEAST2_MRDOCS )
166166 return ()
167167endif ()
168168
169- add_library (boost_http_io include /boost/http_io .hpp build /Jamfile ${BOOST_HTTP_IO_HEADERS } ${BOOST_HTTP_IO_SOURCES } )
170- add_library (Boost::http_io ALIAS boost_http_io )
171- boost_http_io_setup_properties(boost_http_io )
169+ add_library (boost_beast2 include /boost/beast2 .hpp build /Jamfile ${BOOST_BEAST2_HEADERS } ${BOOST_BEAST2_SOURCES } )
170+ add_library (Boost::beast2 ALIAS boost_beast2 )
171+ boost_beast2_setup_properties(boost_beast2 )
172172
173173#-------------------------------------------------
174174#
175175# Tests
176176#
177177#-------------------------------------------------
178- if (BOOST_HTTP_IO_BUILD_TESTS )
178+ if (BOOST_BEAST2_BUILD_TESTS )
179179 add_subdirectory (test )
180180endif ()
181181
@@ -184,6 +184,6 @@ endif ()
184184# Examples
185185#
186186#-------------------------------------------------
187- if (BOOST_HTTP_IO_BUILD_EXAMPLES )
187+ if (BOOST_BEAST2_BUILD_EXAMPLES )
188188 add_subdirectory (example)
189189endif ()
0 commit comments