]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/callable_traits/test/CMakeLists.txt
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / callable_traits / test / CMakeLists.txt
CommitLineData
b32b8144
FG
1
2# Copyright Louis Dionne 2015
3# Modified Work Copyright Barrett Adair 2015-2017
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
6
7add_custom_target(tests COMMENT "Build all the unit tests.")
8add_custom_target(tests.quick COMMENT "Build a subset of all the unit tests to finish faster.")
9
10##############################################################################
11# callable_traits_add_unit_test(<name> ...)
12#
13# Equivalent to `callable_traits_add_test`, except the test is also added as a
14# dependency of the `tests` target.
15##############################################################################
16
92f5a8d4
TL
17function(boost_callable_traits_add_unit_test name)
18 boost_callable_traits_add_test(${ARGV})
b32b8144
FG
19 add_dependencies(tests ${name})
20 if ((NOT "${name}" MATCHES "\\.ext\\.") AND (NOT "${name}" MATCHES "_mcd"))
21 add_dependencies(tests.quick ${name})
22 endif()
23endfunction()
24
92f5a8d4 25include_directories(${boost_callable_traits_SOURCE_DIR}/include)
b32b8144
FG
26include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
27include_directories(${CMAKE_CURRENT_LIST_DIR})
28
29file(GLOB_RECURSE UNIT_TESTS "*.cpp")
30
31foreach(_file IN LISTS UNIT_TESTS)
92f5a8d4 32 boost_callable_traits_target_name_for(_target "${_file}")
b32b8144
FG
33 add_executable(${_target} EXCLUDE_FROM_ALL "${_file}")
34 set(lazy_target "lazy_${_target}")
35 add_executable(${lazy_target} EXCLUDE_FROM_ALL "${_file}")
36 target_compile_definitions(${lazy_target} INTERFACE -DUSE_LAZY_TYPES)
92f5a8d4
TL
37 boost_callable_traits_add_unit_test(${_target} ${CMAKE_CURRENT_BINARY_DIR}/${_target})
38 boost_callable_traits_add_unit_test(${lazy_target} ${CMAKE_CURRENT_BINARY_DIR}/${_target})
b32b8144
FG
39endforeach()
40
92f5a8d4 41add_dependencies(callable_traits_check tests)