1 # Copyright 2020, 2021 Peter Dimov
2 # Distributed under the Boost Software License, Version 1.0.
3 # https://www.boost.org/LICENSE_1_0.txt
5 cmake_minimum_required(VERSION 3.5...3.16)
7 project(boost_container VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES C CXX)
9 add_library(boost_container
12 src/global_resource.cpp
13 src/monotonic_buffer_resource.cpp
15 src/synchronized_pool_resource.cpp
16 src/unsynchronized_pool_resource.cpp
19 add_library(Boost::container ALIAS boost_container)
21 target_include_directories(boost_container PUBLIC include)
23 target_link_libraries(boost_container
35 target_compile_definitions(boost_container
36 PUBLIC BOOST_CONTAINER_NO_LIB
37 # Source files already define BOOST_CONTAINER_SOURCE
38 # PRIVATE BOOST_CONTAINER_SOURCE
42 target_compile_definitions(boost_container PUBLIC BOOST_CONTAINER_DYN_LINK)
44 target_compile_definitions(boost_container PUBLIC BOOST_CONTAINER_STATIC_LINK)
47 if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
49 add_subdirectory(test)