From e9ceb6c8940cd9bbd5232230d3438509b744b00b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Jun 2021 20:34:28 +0300 Subject: [PATCH] Add a Boost-friendly subproject case to CMakeLists closes #2254 --- CHANGELOG.md | 1 + CMakeLists.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3c8bfff..2f808957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Add a Boost-friendly subproject case to CMakeLists. * Remove use of POSIX-only constant. -------------------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dab9cbd..9ab5e8a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,45 @@ +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::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) # @@ -255,3 +297,5 @@ endif() if (Beast_BUILD_TESTS) add_subdirectory (test) endif() + +endif()