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_random VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
9 add_library(boost_random
13 add_library(Boost::random ALIAS boost_random)
15 target_include_directories(boost_random PUBLIC include)
17 target_link_libraries(boost_random
29 Boost::throw_exception
34 target_compile_definitions(boost_random
35 PUBLIC BOOST_RANDOM_NO_LIB
36 # Source files already define BOOST_RANDOM_SOURCE
37 # PRIVATE BOOST_RANDOM_SOURCE
41 target_compile_definitions(boost_random PUBLIC BOOST_RANDOM_DYN_LINK)
43 target_compile_definitions(boost_random PUBLIC BOOST_RANDOM_STATIC_LINK)
46 if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
48 add_subdirectory(test)