igmpgen/CMakeLists.txt

25 lines
748 B
Text
Raw Normal View History

2023-12-24 19:27:59 +00:00
cmake_minimum_required(VERSION 3.25)
2023-12-24 19:27:59 +00:00
# Set the project name and version
project(IGMPPacketGenerator VERSION 1.0)
# Specify the C standard
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
# Add the executable
2023-12-24 19:27:59 +00:00
add_executable(igmpgen src/igmpgen.c)
# Detect the net library
find_library(LIBNET_LIBRARY NAMES net libnet libnet1 REQUIRED)
message(STATUS "libnet detected as ${LIBNET_LIBRARY}")
# Add the directories where the compiler can find the libnet headers
target_include_directories(igmpgen PRIVATE /usr/include)
# Add the directories where the compiler can find the libnet libraries
target_link_directories(igmpgen PRIVATE /usr/lib)
2023-12-24 19:27:59 +00:00
# Link the executable to the libnet library
2023-12-24 19:27:59 +00:00
target_link_libraries(igmpgen ${LIBNET_LIBRARY})