CMakeLists.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. cmake_minimum_required( VERSION 3.5 )
  8. project( BoostRatio LANGUAGES CXX)
  9. option( BOOST_RATIO_INCLUDE_TESTS "Add boost ratio tests" OFF )
  10. add_library( boost_ratio INTERFACE )
  11. add_library( Boost::ratio ALIAS boost_ratio )
  12. target_include_directories( boost_ratio INTERFACE include )
  13. target_link_libraries( boost_ratio
  14. INTERFACE
  15. Boost::config
  16. Boost::core
  17. Boost::integer
  18. Boost::mpl
  19. Boost::static_assert
  20. Boost::type_traits
  21. # NOTE: As of Boost 1.70, the dependency on rational is only
  22. # necessary, if BOOST_RATIO_EXTENSIONS is defined.
  23. # Maybe consuming libraries that do so should add
  24. # Boost::rational as a dependency themselves,
  25. # instead of doing it here for everyone?
  26. Boost::rational
  27. )
  28. if( BOOST_RATIO_INCLUDE_TESTS )
  29. enable_testing()
  30. add_subdirectory( test )
  31. endif()