File: CMakeLists.txt

package info (click to toggle)
boost1.88 1.88.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 576,932 kB
  • sloc: cpp: 4,149,234; xml: 136,789; ansic: 35,092; python: 33,910; asm: 5,698; sh: 4,604; ada: 1,681; makefile: 1,633; pascal: 1,139; perl: 1,124; sql: 640; yacc: 478; ruby: 271; java: 77; lisp: 24; csh: 6
file content (39 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright 2019 Mike Dev
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#
# NOTE: CMake support for Boost.Parameter is currently experimental at best
#       and the interface is likely to change in the future

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

# TODO: Also process literate tests
file(GLOB test_files *.cpp)

# remove some test for which the dependencies are not yet available or have
# special requirements
# TODO: enable more tests
list(FILTER test_files EXCLUDE REGEX
    efficiency|deduced_unmatched_arg|duplicates)

# Attach all our tests to the `tests` target, to enable
# `cmake --build . --target tests`
if(NOT TARGET tests)
  add_custom_target(tests)
endif()

foreach(file IN LISTS test_files)

    get_filename_component(core_name ${file} NAME_WE)
    set(test_name boost_parameter-test-${core_name})

    add_executable(${test_name} EXCLUDE_FROM_ALL ${file})
    add_dependencies(tests ${test_name})

    # add Boost.Parameter and any libraries that are only needed by the tests
    # (none at the moment)
    target_link_libraries(${test_name} Boost::parameter)

    add_test(NAME ${test_name} COMMAND ${test_name})

endforeach()