-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
44 lines (36 loc) · 1.27 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
43
44
cmake_minimum_required(VERSION 3.10)
project(babysniff
VERSION 0.1
DESCRIPTION "A simple sniffer written from scratch without any libraries"
LANGUAGES C
)
file(GLOB babysniff_srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"src/*.c"
"src/compat/*.c"
"src/proto/*.c"
"src/proto/dns/*.c"
"src/types/*.c"
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
file(GLOB babysniff_srcs_platform RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/platform/linux/*.c")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
file(GLOB babysniff_srcs_platform RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/platform/bsd/*.c")
endif()
add_executable(babysniff ${babysniff_srcs} ${babysniff_srcs_platform})
target_include_directories(babysniff PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/compat
${PROJECT_SOURCE_DIR}/src/proto
${PROJECT_SOURCE_DIR}/src/proto/dns
${PROJECT_SOURCE_DIR}/src/types
)
target_compile_definitions(babysniff PRIVATE _GNU_SOURCE=1 DEBUG)
target_compile_options(babysniff PRIVATE -W -Wall -Wextra -std=c99 -pedantic -ggdb3 -O0)
#target_link_options(babysniff ...)
set_target_properties(babysniff
PROPERTIES
C_STANDARD 11
C_STANDARD_REQUIRED YES
C_EXTENSIONS NO
)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})