]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
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.Parameter is currently experimental at best | |
6 | # and the interface is likely to change in the future | |
7 | ||
8 | # TODO: Also process literate tests | |
9 | file(GLOB test_files *.cpp) | |
10 | ||
1e59de90 TL |
11 | # remove some test for which the dependencies are not yet available or have |
12 | # special requirements | |
92f5a8d4 TL |
13 | # TODO: enable more tests |
14 | list(FILTER test_files EXCLUDE REGEX | |
1e59de90 TL |
15 | efficiency|deduced_unmatched_arg|duplicates) |
16 | ||
17 | # Attach all our tests to the `tests` target, to enable | |
18 | # `cmake --build . --target tests` | |
19 | if(NOT TARGET tests) | |
20 | add_custom_target(tests) | |
21 | endif() | |
92f5a8d4 TL |
22 | |
23 | foreach(file IN LISTS test_files) | |
24 | ||
25 | get_filename_component(core_name ${file} NAME_WE) | |
1e59de90 TL |
26 | set(test_name boost_parameter-test-${core_name}) |
27 | ||
28 | add_executable(${test_name} EXCLUDE_FROM_ALL ${file}) | |
29 | add_dependencies(tests ${test_name}) | |
92f5a8d4 | 30 | |
1e59de90 TL |
31 | # add Boost.Parameter and any libraries that are only needed by the tests |
32 | # (none at the moment) | |
92f5a8d4 TL |
33 | target_link_libraries(${test_name} Boost::parameter) |
34 | ||
35 | add_test(NAME ${test_name} COMMAND ${test_name}) | |
36 | ||
1e59de90 | 37 | endforeach() |