forked from cloudshark/cshark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (38 loc) · 1.26 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
45
46
47
48
49
50
cmake_minimum_required(VERSION 2.6)
project(cshark C)
add_definitions(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/modules")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(SOURCES
src/cshark.c
src/cshark.h
src/pcap.c
src/pcap.h
src/uclient.c
src/uclient.h
src/config.c
src/config.h
)
add_executable(cshark ${SOURCES})
if(WITH_DEBUG)
add_definitions(-DWITH_DEBUG -g3)
endif()
find_package(LIBUBOX REQUIRED)
include_directories(${LIBUBOX_INCLUDE_DIR})
target_link_libraries(cshark ${LIBUBOX_LIBRARIES})
find_package(LIBUCLIENT REQUIRED)
include_directories(${LIBUCLIENT_INCLUDE_DIR})
target_link_libraries(cshark ${LIBUCLIENT_LIBRARIES})
find_package(LIBPCAP REQUIRED)
include_directories(${LIBPCAP_INCLUDE_DIR})
target_link_libraries(cshark ${LIBPCAP_LIBRARIES})
find_package(UCI REQUIRED)
include_directories(${UCI_INCLUDE_DIR})
target_link_libraries(cshark ${UCI_LIBRARIES})
find_package(JSON-C REQUIRED)
include_directories(${JSON-C_INCLUDE_DIR})
target_link_libraries(cshark ${JSON-C_LIBRARIES})
# libdl must be on the system
target_link_libraries(cshark dl)
install(TARGETS cshark RUNTIME DESTINATION bin)