diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b7444a6f5d97d49a22d04c524eb05cce5129bee..07c3bab98301e492107a97ddb8df67b91ba88aa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,7 @@ test_big_endian(WORDS_BIGENDIAN) find_package(ORTP REQUIRED) find_package(PolarSSL) +find_package(PCAP) if(ENABLE_UNIT_TESTS) find_package(CUnit) @@ -265,6 +266,9 @@ include_directories( ${ORTP_INCLUDE_DIRS} ) +if(PCAP_FOUND) + include_directories(${PCAP_INCLUDE_DIRS}) +endif() if(SRTP_FOUND) include_directories(${SRTP_INCLUDE_DIRS}) endif() @@ -330,6 +334,9 @@ endif() if(ENABLE_NON_FREE_CODECS) set(HAVE_NON_FREE_CODECS 1) endif() +if(PCAP_FOUND) + set(HAVE_PCAP 1) +endif() if(SRTP_FOUND) set(HAVE_SRTP 1) endif() diff --git a/cmake/FindPCAP.cmake b/cmake/FindPCAP.cmake index 6015a45f9794447bcf17fc77388a8a2a8eb2faf9..c7a20bc9433490e646905bac862094808d86339a 100644 --- a/cmake/FindPCAP.cmake +++ b/cmake/FindPCAP.cmake @@ -27,7 +27,6 @@ # PCAP_LIBRARIES - The libraries needed to use pcap set(_PCAP_ROOT_PATHS - ${WITH_PCAP} ${CMAKE_INSTALL_PREFIX} ) diff --git a/mediastreamer-config.h.cmake b/mediastreamer-config.h.cmake index 2a054e62817271647fe59d9b1d1cfe6c33850ea4..1e8e6ebd5896a1f1a4381d61f7165f08e0b51cca 100644 --- a/mediastreamer-config.h.cmake +++ b/mediastreamer-config.h.cmake @@ -66,3 +66,4 @@ #cmakedefine HAVE_LINUX_VIDEODEV_H 1 #cmakedefine HAVE_LINUX_VIDEODEV2_H 1 #cmakedefine HAVE_POLARSSL_SSL_H 1 +#cmakedefine HAVE_PCAP 1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b67e5efd970f2d27e7decfce0b09dc876ad92410..3a3529c5ce4a447fc363ba1482163ed748100b47 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -338,6 +338,9 @@ endif() if(HAVE_DLOPEN) list(APPEND VOIP_LIBS dl) endif() +if(PCAP_FOUND) + list(APPEND VOIP_LIBS ${PCAP_LIBRARIES}) +endif() if(BZRTP_FOUND) list(APPEND VOIP_LIBS ${BZRTP_LIBRARIES}) endif() diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4e3b23528b9c661ce0897811e413c68cda6e846d..c5b3920d826a6f23aff41a09d0077dd445ab2cb6 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -29,7 +29,6 @@ foreach (simple_executable ${simple_executables}) target_link_libraries(${simple_executable} mediastreamer_voip mediastreamer_base) endforeach() -find_package(PCAP QUIET) if (PCAP_FOUND) add_executable(pcap_playback pcap_playback.c common.c) target_link_libraries(pcap_playback mediastreamer_voip mediastreamer_base)