1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(stc-plugin-pcap C)
4 # Set required packages
6 PKG_CHECK_MODULES(pcap_plugin REQUIRED
13 FOREACH(flag ${pcap_plugin_CFLAGS})
14 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
17 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
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")
23 ADD_DEFINITIONS("-DUSE_DLOG")
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})
36 INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${LIBDIR})