2 file(GLOB PROJECT_SOURCE_LIST_WIN32_C ${pcap_SOURCE_DIR}/missing/getopt.c)
3 include_directories(${pcap_SOURCE_DIR}/missing)
6 add_custom_target(testprogs)
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})
16 target_link_libraries(${_executable}
17 ${ARGN} ${LIBRARY_NAME} ${PCAP_LINK_LIBRARIES})
19 target_link_libraries(${_executable}
20 ${ARGN} ${LIBRARY_NAME}_static ${PCAP_LINK_LIBRARIES})
22 if(NOT "${LINKER_FLAGS}" STREQUAL "")
23 set_target_properties(${_executable} PROPERTIES
24 LINK_FLAGS "${LINKER_FLAGS}")
26 add_dependencies(testprogs ${_executable})
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)
40 add_test_executable(selpolltest)
43 add_test_executable(threadsignaltest ${CMAKE_THREAD_LIBS_INIT})
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)
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)