]> The Tcpdump Group git mirrors - libpcap/blob - testprogs/CMakeLists.txt
CI: Call print_so_deps() on rpcapd in remote enabled build
[libpcap] / testprogs / CMakeLists.txt
1 if(MSVC)
2 file(GLOB PROJECT_SOURCE_LIST_WIN32_C ${pcap_SOURCE_DIR}/missing/getopt.c)
3 include_directories(${pcap_SOURCE_DIR}/missing)
4 endif(MSVC)
5
6 add_custom_target(testprogs)
7
8 macro(add_test_executable _executable)
9 add_executable(${_executable} EXCLUDE_FROM_ALL
10 ${_executable}.c ${PROJECT_SOURCE_LIST_WIN32_C})
11 if(NOT C_ADDITIONAL_FLAGS STREQUAL "")
12 set_target_properties(${_executable} PROPERTIES
13 COMPILE_FLAGS ${C_ADDITIONAL_FLAGS})
14 endif()
15 if(WIN32)
16 target_link_libraries(${_executable}
17 ${ARGN} ${LIBRARY_NAME} ${PCAP_LINK_LIBRARIES})
18 else(WIN32)
19 target_link_libraries(${_executable}
20 ${ARGN} ${LIBRARY_NAME}_static ${PCAP_LINK_LIBRARIES})
21 endif(WIN32)
22 if(NOT "${LINKER_FLAGS}" STREQUAL "")
23 set_target_properties(${_executable} PROPERTIES
24 LINK_FLAGS "${LINKER_FLAGS}")
25 endif()
26 add_dependencies(testprogs ${_executable})
27 endmacro()
28
29 add_test_executable(activatetest)
30 add_test_executable(can_set_rfmon_test)
31 add_test_executable(capturetest)
32 add_test_executable(filtertest)
33 add_test_executable(findalldevstest)
34 add_test_executable(findalldevstest-perf)
35 add_test_executable(opentest)
36 add_test_executable(reactivatetest)
37 add_test_executable(writecaptest)
38
39 if(NOT WIN32)
40 add_test_executable(selpolltest)
41 endif()
42
43 add_test_executable(threadsignaltest ${CMAKE_THREAD_LIBS_INIT})
44
45 # Same as in configure.ac.
46 if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
47 CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR
48 CMAKE_SYSTEM_NAME STREQUAL "Linux")
49 add_test_executable(valgrindtest)
50 endif()
51
52 if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
53 CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR
54 CMAKE_SYSTEM_NAME STREQUAL "Linux")
55 if(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git)
56 add_subdirectory(fuzz)
57 endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git)
58 endif()