1
0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-11-23 00:52:00 +01:00

Moved pcap library search to happen before we use results from it

This commit is contained in:
Pavel Odintsov 2023-08-22 13:36:18 +01:00
parent a4bc0cc402
commit a6b2afa6ac

@ -459,6 +459,19 @@ if (ENABLE_LIBBPF_SUPPORT)
endif()
### Look for libpcap
find_path(LIBPCAP_INCLUDES_FOLDER NAMES pcap.h PATHS "${LIBPCAP_CUSTOM_INSTALL_PATH}/include" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
find_library(LIBPCAP_LIBRARY_PATH NAMES pcap PATHS "${LIBPCAP_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
if (LIBPCAP_INCLUDES_FOLDER AND LIBPCAP_LIBRARY_PATH)
message(STATUS "We found pcap library ${LIBPCAP_LIBRARY_PATH}")
include_directories(${LIBPCAP_INCLUDES_FOLDER})
else()
message(FATAL_ERROR "We can't find pcap library")
endif()
if (ENABLE_AF_XDP_SUPPORT)
@ -872,20 +885,6 @@ if (ENABLE_MONGODB_SUPPORT)
endif()
### Look for libpcap
find_path(LIBPCAP_INCLUDES_FOLDER NAMES pcap.h PATHS "${LIBPCAP_CUSTOM_INSTALL_PATH}/include" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
find_library(LIBPCAP_LIBRARY_PATH NAMES pcap PATHS "${LIBPCAP_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
if (LIBPCAP_INCLUDES_FOLDER AND LIBPCAP_LIBRARY_PATH)
message(STATUS "We found pcap library ${LIBPCAP_LIBRARY_PATH}")
include_directories(${LIBPCAP_INCLUDES_FOLDER})
else()
message(FATAL_ERROR "We can't find pcap library")
endif()
### Look for log4cpp
# Try to find log4cpp includes path