aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libpcap/libpcap/testprogs/CMakeLists.txt
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-05-10 14:55:20 -0400
committerCameron Katri <me@cameronkatri.com>2021-05-10 14:55:20 -0400
commitd88d199f23088ac1c3d7696374b0a1c1c1c18358 (patch)
tree977307e478f76c5de5ca141268cf8ce0309a09eb /lib/libpcap/libpcap/testprogs/CMakeLists.txt
parent5fd83771641d15c418f747bd343ba6738d3875f7 (diff)
downloadapple_cmds-d88d199f23088ac1c3d7696374b0a1c1c1c18358.tar.gz
apple_cmds-d88d199f23088ac1c3d7696374b0a1c1c1c18358.tar.zst
apple_cmds-d88d199f23088ac1c3d7696374b0a1c1c1c18358.zip
libpcap-98.40.1
Diffstat (limited to 'lib/libpcap/libpcap/testprogs/CMakeLists.txt')
-rw-r--r--lib/libpcap/libpcap/testprogs/CMakeLists.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/libpcap/libpcap/testprogs/CMakeLists.txt b/lib/libpcap/libpcap/testprogs/CMakeLists.txt
new file mode 100644
index 0000000..b8ef9b7
--- /dev/null
+++ b/lib/libpcap/libpcap/testprogs/CMakeLists.txt
@@ -0,0 +1,40 @@
+if(MSVC)
+ file(GLOB PROJECT_SOURCE_LIST_WIN32_C ${pcap_SOURCE_DIR}/missing/getopt.c)
+ include_directories(${pcap_SOURCE_DIR}/missing)
+endif(MSVC)
+
+add_custom_target(testprogs)
+
+macro(add_test_executable _executable)
+ add_executable(${_executable} EXCLUDE_FROM_ALL
+ ${_executable}.c ${PROJECT_SOURCE_LIST_WIN32_C})
+ if(NOT C_ADDITIONAL_FLAGS STREQUAL "")
+ set_target_properties(${_executable} PROPERTIES
+ COMPILE_FLAGS ${C_ADDITIONAL_FLAGS})
+ endif()
+ if(WIN32)
+ target_link_libraries(${_executable}
+ ${ARGN} ${LIBRARY_NAME} ${PCAP_LINK_LIBRARIES})
+ else(WIN32)
+ target_link_libraries(${_executable}
+ ${ARGN} ${LIBRARY_NAME}_static ${PCAP_LINK_LIBRARIES})
+ endif(WIN32)
+ add_dependencies(testprogs ${_executable})
+endmacro()
+
+add_test_executable(can_set_rfmon_test)
+add_test_executable(capturetest)
+add_test_executable(filtertest)
+add_test_executable(findalldevstest)
+add_test_executable(opentest)
+add_test_executable(reactivatetest)
+
+if(NOT WIN32)
+ add_test_executable(selpolltest)
+endif()
+
+add_test_executable(threadsignaltest ${CMAKE_THREAD_LIBS_INIT})
+
+if(NOT WIN32)
+ add_test_executable(valgrindtest)
+endif()