be4b022a52e5bf87a41294ff44dfdb2821cc19c8
[platform/core/connectivity/stc-manager.git] / plugin / pcap / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(stc-plugin-pcap C)
3
4 # Set required packages
5 INCLUDE(FindPkgConfig)
6 PKG_CHECK_MODULES(pcap_plugin REQUIRED
7         dlog
8         gio-2.0
9         gio-unix-2.0
10         glib-2.0
11         )
12
13 FOREACH(flag ${pcap_plugin_CFLAGS})
14         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
15 ENDFOREACH(flag)
16
17 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
18
19 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Werror -fvisibility=hidden")
20 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
21 SET(CMAKE_C_FLAGS_RELEASE "-O2")
22
23 ADD_DEFINITIONS("-DUSE_DLOG")
24
25 SET(SRCS_PLUGIN
26         stc-plugin-pcap.c
27         )
28
29 # library build
30 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS_PLUGIN})
31 ADD_DEPENDENCIES(${PROJECT_NAME} GENERATED_DBUS_CODE)
32 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pcap_plugin_LDFLAGS} -lpcap)
33 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "" OUTPUT_NAME ${PROJECT_NAME})
34
35 # install
36 INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${LIBDIR})