CMakeLists.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright 2018 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. cmake_minimum_required(VERSION 3.5)
  5. # NOTE: Individual boost cmake files might require a higher cmake version
  6. project(boost LANGUAGES CXX)
  7. #=== options ===
  8. # Some libraries' cmake files don't work well with this cmake file, e.g. because
  9. # - they are generally not designed to support the add_subdirectory workflow at all
  10. # - they define targets with conflicting names (e.g. check)
  11. # - require some additional (internal or external) dependencies
  12. #
  13. # Those libraries can be excluded here
  14. set(BOOST_RATIO_IGNORE_LIBS callable_traits;hof;compute;gil;hana;yap;safe_numerics;beast CACHE STRING "List of libraries that will be excluded from cmake build")
  15. #~~~ options ~~~
  16. message(STATUS "[Boost] Excluded libs (BOOST_RATIO_IGNORE_LIBS): ${BOOST_RATIO_IGNORE_LIBS}")
  17. # cmake doesn't require autolinking and currently most cmake files don't produce
  18. # name mangled libraries anyway
  19. add_definitions(-DBOOST_ALL_NO_LIB)
  20. enable_testing()
  21. # Detect and process all CMakeLists files that reside in the root folder of a library
  22. file(GLOB boost_libs_with_cmake_files ../../../../libs/*/CMakeLists.txt)
  23. foreach(cmake_file IN LISTS boost_libs_with_cmake_files)
  24. get_filename_component(dir ${cmake_file} DIRECTORY)
  25. get_filename_component(lib_name ${dir} NAME)
  26. if(NOT lib_name IN_LIST BOOST_RATIO_IGNORE_LIBS)
  27. add_subdirectory(${dir} ${lib_name})
  28. endif()
  29. endforeach()