-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
42 lines (30 loc) · 1.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.16)
# Set the project name
project (b2-sniffer)
# Set the C++ standard C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
# Enable clang-tidy
# set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*")
# Lib PCAP
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH})
set(PCAP_DIR "${CMAKE_CURRENT_LIST_DIR}")
find_package(PCAP)
# If Capture from PCAP Files, VelodyneCapture are required PCAP.
# Please Define HAVE_PCAP in Preprocessor.
set(HAVE_PCAP)
if(PCAP_FOUND)
set(HAVE_PCAP "-DHAVE_PCAP")
endif()
# Lib fmt
add_subdirectory(3rdparty/fmt)
# Add an executable
add_executable(b2-sniffer main.cpp b2sniffer.cpp)
# Set the C++ standard to the appropriate standard for using auto
target_compile_features(b2-sniffer PUBLIC cxx_auto_type)
# Link Libraries
target_link_libraries(b2-sniffer PRIVATE ${PCAP_LIBRARIES} cap fmt::fmt)
# Print Compile Features
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")
# Install
install(TARGETS b2-sniffer DESTINATION bin)