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_type_erasure VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
9 add_library(boost_type_erasure
10 src/dynamic_binding.cpp
13 add_library(Boost::type_erasure ALIAS boost_type_erasure)
15 target_include_directories(boost_type_erasure PUBLIC include)
17 target_link_libraries(boost_type_erasure
28 Boost::throw_exception
36 target_compile_definitions(boost_type_erasure
37 PUBLIC BOOST_TYPE_ERASURE_NO_LIB
38 # Source files already define BOOST_TYPE_ERASURE_SOURCE
39 # PRIVATE BOOST_TYPE_ERASURE_SOURCE
43 target_compile_definitions(boost_type_erasure PUBLIC BOOST_TYPE_ERASURE_DYN_LINK)
45 target_compile_definitions(boost_type_erasure PUBLIC BOOST_TYPE_ERASURE_STATIC_LINK)
48 if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
50 add_subdirectory(test)