-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
34 lines (27 loc) · 941 Bytes
/
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
cmake_minimum_required (VERSION 2.6)
project (sitd C)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 -Wall -Wextra")
find_path(NL_INCLUDE_DIR netlink/netlink.h
/usr/include
/usr/include/libnl3
/usr/local/include
/usr/local/include/libnl3
)
find_library(NL_LIBRARY NAMES nl nl-3)
find_library(NL_ROUTE_LIBRARY NAMES nl-route nl-route-3)
if (NL_INCLUDE_DIR AND NL_LIBRARY)
set(NL_LIBRARIES ${NL_LIBRARY} ${NL_ROUTE_LIBRARY})
ELSE (NL_INCLUDE_DIR AND NL_LIBRARY)
message("libnl-*-3-dev packages cannot be found.")
message("in debian, install the following to continue:")
message("libnl-3-dev libnl-route-3-dev")
message(FATAL_ERROR "can't find libnl.")
endif (NL_INCLUDE_DIR AND NL_LIBRARY)
include_directories("${PROJECT_SOURCE_DIR}" "${NL_INCLUDE_DIR}")
add_executable(sitd
src/api.c
src/sit.c
src/sitd.c
src/db.c
)
target_link_libraries(sitd microhttpd jansson sqlite3 ${NL_LIBRARIES})