aboutsummaryrefslogtreecommitdiffstats
path: root/trial/direct_bt/CMakeLists.txt
blob: e982207fad50ff8dacd10f652243a5b32182b800 (plain)
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
include_directories(
  ${PROJECT_SOURCE_DIR}/jaulib/include
  ${PROJECT_SOURCE_DIR}/api
)

# These examples use the standard separate compilation
file(GLOB_RECURSE SOURCES_IDIOMATIC_TRIALS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "test_*.cpp")
string( REPLACE ".cpp" "" TARGETS_IDIOMATIC_TRIALS "${SOURCES_IDIOMATIC_TRIALS}" )

foreach( name ${TARGETS_IDIOMATIC_TRIALS} )
    add_executable(${name} ${name}.cpp)
    target_link_libraries(${name} direct_bt catch2)
    add_dependencies(${name} direct_bt catch2)
    add_test (NAME ${name} COMMAND sudo -E /sbin/capsh --caps=cap_net_raw,cap_net_admin+eip\ cap_setpcap,cap_setuid,cap_setgid+ep
                           --keep=1 --user=$ENV{USER} --addamb=cap_net_raw,cap_net_admin+eip
                           -- -c "ulimit -c unlimited; ./${name}")
endforeach()

file(GLOB_RECURSE SOURCES_IDIOMATIC_PROVOCATIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "provoke_*.cpp")
string( REPLACE ".cpp" "" TARGETS_IDIOMATIC_PROVOCATIONS "${SOURCES_IDIOMATIC_PROVOCATIONS}" )

foreach( name ${TARGETS_IDIOMATIC_PROVOCATIONS} )
    add_executable(${name} ${name}.cpp)
    target_link_libraries(${name} direct_bt catch2)
    add_dependencies(${name} direct_bt catch2)
endforeach()