• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 Mike Dev
2# Distributed under the Boost Software License, Version 1.0.
3# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
4#
5# NOTE: CMake support for Boost.Ratio is currently experimental at best
6#       and the interface is likely to change in the future
7
8cmake_minimum_required( VERSION 3.5 )
9project( BoostRatio LANGUAGES CXX)
10option( BOOST_RATIO_INCLUDE_TESTS "Add boost ratio tests" OFF )
11
12add_library( boost_ratio INTERFACE )
13add_library( Boost::ratio ALIAS boost_ratio )
14
15target_include_directories( boost_ratio INTERFACE include )
16
17target_link_libraries( boost_ratio
18    INTERFACE
19        Boost::config
20        Boost::core
21        Boost::integer
22        Boost::mpl
23        Boost::static_assert
24        Boost::type_traits
25
26# NOTE: As of Boost 1.70, the dependency on rational is only
27#       necessary, if BOOST_RATIO_EXTENSIONS is defined.
28#       Maybe consuming libraries that do so should add
29#       Boost::rational as a dependency themselves,
30#       instead of doing it here for everyone?
31        Boost::rational
32)
33
34if( BOOST_RATIO_INCLUDE_TESTS )
35    enable_testing()
36    add_subdirectory( test )
37endif()
38