CMakeLists.txt 880 B

123456789101112131415161718192021222324252627282930313233343536373839
  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/endian)
  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(config)
  13. boost_add_subdir(core)
  14. boost_add_subdir(predef)
  15. boost_add_subdir(static_assert)
  16. boost_add_subdir(type_traits)
  17. # secondary dependencies
  18. boost_add_subdir(assert)
  19. # --target check
  20. add_executable(quick ../quick.cpp)
  21. target_link_libraries(quick Boost::endian Boost::core)
  22. enable_testing()
  23. add_test(quick quick)
  24. add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)