add_library( Pcap++ $<$:src/DpdkDevice.cpp> $<$:src/DpdkDeviceList.cpp> $<$:src/KniDevice.cpp> $<$:src/KniDeviceList.cpp> $<$:src/LinuxNicInformationSocket.cpp> $<$:src/MBufRawPacket.cpp> src/NetworkUtils.cpp src/PcapFileDevice.cpp src/PcapDevice.cpp src/PcapFilter.cpp src/PcapLiveDevice.cpp src/PcapLiveDeviceList.cpp $<$:src/PcapRemoteDevice.cpp> $<$:src/PcapRemoteDeviceList.cpp> $<$:src/PfRingDevice.cpp> $<$:src/PfRingDeviceList.cpp> src/RawSocketDevice.cpp $<$:src/WinPcapLiveDevice.cpp> # Force light pcapng to be link fully static $) set(public_headers header/Device.h header/NetworkUtils.h header/PcapDevice.h header/PcapFileDevice.h header/PcapFilter.h header/PcapLiveDevice.h header/PcapLiveDeviceList.h header/RawSocketDevice.h) if(PCAPPP_USE_DPDK) list( APPEND public_headers header/KniDevice.h header/DpdkDeviceList.h header/KniDeviceList.h header/DpdkDevice.h header/MBufRawPacket.h) endif() if(PCAPPP_USE_PF_RING) list( APPEND public_headers header/PfRingDevice.h header/PfRingDeviceList.h) endif() if(LINUX) list(APPEND public_headers header/LinuxNicInformationSocket.h) endif() if(WIN32) list( APPEND public_headers header/WinPcapLiveDevice.h header/PcapRemoteDevice.h header/PcapRemoteDeviceList.h) endif() set_property(TARGET Pcap++ PROPERTY PUBLIC_HEADER ${public_headers}) if(APPLE) target_link_libraries(Pcap++ PRIVATE "-framework CoreFoundation" "-framework SystemConfiguration") elseif(WIN32) target_compile_definitions(Pcap++ PUBLIC -DHAVE_REMOTE) target_compile_definitions(Pcap++ PUBLIC -DWPCAP) target_link_libraries(Pcap++ PRIVATE ws2_32 iphlpapi) target_link_libraries(Pcap++ PUBLIC Packet::Packet) endif() target_include_directories( Pcap++ PUBLIC $ $ # Don't link with EndianPortable nor Light_PcapNG as they won't be exported PRIVATE $ $) target_link_libraries( Pcap++ PUBLIC Common++ Packet++ $<$:PF_RING::PF_RING> $<$:DPDK::DPDK> PCAP::PCAP Threads::Threads) if(LIGHT_PCAPNG_ZSTD) target_link_libraries(Pcap++ PRIVATE light_pcapng) endif() if(PCAPPP_INSTALL) install( TARGETS Pcap++ EXPORT PcapPlusPlusTargets ARCHIVE DESTINATION ${PCAPPP_INSTALL_LIBDIR} LIBRARY DESTINATION ${PCAPPP_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${PCAPPP_INSTALL_INCLUDEDIR} RUNTIME DESTINATION ${PCAPPP_INSTALL_BINDIR}) endif() set_property(TARGET Pcap++ PROPERTY OUTPUT_NAME "Pcap++") set_property(TARGET Pcap++ PROPERTY VERSION ${PCAPPP_VERSION}) set_property(TARGET Pcap++ PROPERTY COMPILE_WARNING_AS_ERROR ON)