开发者

How do I tell cmake to do these two steps to use winpcap?

开发者 https://www.devze.com 2022-12-29 04:32 出处:网络
Quoted from here: If your program uses Win32 specific functions of WinPcap, remember to include WPCAPamong the preprocessor definitions.

Quoted from here:

  • If your program uses Win32 specific functions of WinPcap, remember to include WPCAP among the preprocessor definitions.

  • If your program uses the remote capture capabilities of WinPcap, add HAVE_REMOTE among the preprocessor definitions. Do not include remote-ext.h directly in your source f开发者_StackOverflow中文版iles.

Has anyone managed to use winpcap with cmake?


Something like this should do it:

add_definitions(-DWPCAP -DHAVE_REMOTE)

find_path(WINPCAP_INCLUDE_DIR pcap.h
         ${WINPCAP_HINT_INCLUDE_DIR})

find_library(WINPCAP_LIBRARY NAMES "wpcap"
                             PATHS ${WINPCAP_HINT_LIB_DIR})

...

include_directories(${WINPCAP_INCLUDE_DIR})
target_link_library(my_lib ${WINPCAP_LIBRARY})
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号