CMakeLists.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 2018, 2019 Peter Dimov
  2. # Distributed under the Boost Software License, Version 1.0.
  3. # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
  4. cmake_minimum_required(VERSION 3.5)
  5. project(cmake_subdir_test LANGUAGES CXX)
  6. add_subdirectory(../.. boostorg/function)
  7. # boost_add_subdir
  8. function(boost_add_subdir name)
  9. add_subdirectory(../../../${name} boostorg/${name})
  10. endfunction()
  11. # primary dependencies
  12. boost_add_subdir(assert)
  13. boost_add_subdir(bind)
  14. boost_add_subdir(config)
  15. boost_add_subdir(core)
  16. boost_add_subdir(integer)
  17. boost_add_subdir(preprocessor)
  18. boost_add_subdir(throw_exception)
  19. boost_add_subdir(type_index)
  20. boost_add_subdir(type_traits)
  21. boost_add_subdir(typeof)
  22. # secondary dependencies
  23. boost_add_subdir(static_assert)
  24. boost_add_subdir(container_hash)
  25. boost_add_subdir(smart_ptr)
  26. boost_add_subdir(detail)
  27. boost_add_subdir(move)
  28. boost_add_subdir(predef)
  29. # --target check
  30. add_executable(quick ../quick.cpp)
  31. target_link_libraries(quick Boost::function Boost::core)
  32. enable_testing()
  33. add_test(quick quick)
  34. add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)