1 # Copyright 2020 Peter Dimov
2 # Copyright 2021 Matt Borland
3 # Distributed under the Boost Software License, Version 1.0.
4 # https://www.boost.org/LICENSE_1_0.txt
6 cmake_minimum_required(VERSION 3.5...3.16)
8 project(boost_math VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
10 add_library(boost_math INTERFACE)
12 add_library(Boost::math ALIAS boost_math)
14 target_include_directories(boost_math INTERFACE include)
16 include(CMakeDependentOption)
18 cmake_dependent_option(BOOST_MATH_STANDALONE "Use Boost.Math in standalone mode" ON "NOT BOOST_SUPERPROJECT_VERSION" OFF)
20 message(STATUS "Boost.Math: standalone mode ${BOOST_MATH_STANDALONE}")
22 if(BOOST_MATH_STANDALONE)
24 target_compile_definitions(boost_math INTERFACE BOOST_MATH_STANDALONE=1)
28 target_link_libraries(boost_math
39 Boost::throw_exception
44 # Only enable tests when we're the root project
45 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
48 add_subdirectory(test)