forked from jow-/nlbwmon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
29 lines (21 loc) · 869 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
cmake_minimum_required(VERSION 2.6)
PROJECT(nlbwmon C)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -D_GNU_SOURCE)
OPTION(LIBNL_LIBRARY_TINY "Use LEDE/OpenWrt libnl-tiny" OFF)
SET(SOURCES
client.c database.c neigh.c nfnetlink.c
nlbwmon.c protocol.c socket.c subnets.c
timing.c utils.c)
ADD_EXECUTABLE(nlbwmon ${SOURCES})
IF(LIBNL_LIBRARY_TINY)
TARGET_LINK_LIBRARIES(nlbwmon nl-tiny)
ELSE()
FIND_LIBRARY(LIBNL_LIBRARY NAMES nl-3 nl)
FIND_LIBRARY(LIBNL_GENL_LIBRARY NAMES nl-genl-3 nl-genl)
TARGET_LINK_LIBRARIES(nlbwmon ${LIBNL_LIBRARY} ${LIBNL_GENL_LIBRARY})
FIND_PATH(LIBNL_LIBRARY_INCLUDE_DIR NAMES netlink/netlink.h PATH_SUFFIXES libnl3)
INCLUDE_DIRECTORIES(${LIBNL_LIBRARY_INCLUDE_DIR})
ENDIF()
TARGET_LINK_LIBRARIES(nlbwmon ubox z)
SET(CMAKE_INSTALL_PREFIX /usr)
INSTALL(TARGETS nlbwmon RUNTIME DESTINATION sbin)