1# CMakeLists.txt 2# 3# $Id: CMakeLists.txt 31995 2010-02-24 22:32:10Z jmayer $ 4# 5# Wireshark - Network traffic analyzer 6# By Gerald Combs <[email protected]> 7# Copyright 1998 Gerald Combs 8# 9# This program is free software; you can redistribute it and/or 10# modify it under the terms of the GNU General Public License 11# as published by the Free Software Foundation; either version 2 12# of the License, or (at your option) any later version. 13# 14# This program is distributed in the hope that it will be useful, 15# but WITHOUT ANY WARRANTY; without even the implied warranty of 16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17# GNU General Public License for more details. 18# 19# You should have received a copy of the GNU General Public License 20# along with this program; if not, write to the Free Software 21# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22# 23 24project(btbb-wireshark-plugin C) 25 26cmake_minimum_required(VERSION 2.6) 27set(CMAKE_BACKWARDS_COMPATIBILITY 2.6) 28set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) 29 30IF ( NOT CMAKE_INSTALL_LIBDIR ) 31 set(CMAKE_INSTALL_LIBDIR ~/.wireshark/plugins) 32ENDIF ( NOT CMAKE_INSTALL_LIBDIR ) 33MESSAGE (STATUS "Plugin will be installed in: ${CMAKE_INSTALL_LIBDIR}") 34 35INCLUDE(UseMakeDissectorReg) 36 37set(GLIB2_MIN_VERSION 2.4.0) 38 39find_package(GLIB2) 40include_directories (${GLIB2_INCLUDE_DIRS}) 41 42find_package(Wireshark) 43include_directories (${WIRESHARK_INCLUDE_DIRS}) 44 45set(LINK_MODE_LIB SHARED) 46set(LINK_MODE_MODULE MODULE) 47 48 49set(DISSECTOR_SRC 50 packet-btbb.c 51 packet-btbrlmp.c 52) 53 54set(PLUGIN_FILES 55 plugin.c 56 ${DISSECTOR_SRC} 57) 58 59set(CLEAN_FILES 60 ${PLUGIN_FILES} 61) 62 63if (WERROR) 64 set_source_files_properties( 65 ${CLEAN_FILES} 66 PROPERTIES 67 COMPILE_FLAGS -Werror 68 ) 69endif() 70 71include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 72 73register_dissector_files(plugin.c 74 plugin 75 ${DISSECTOR_SRC} 76) 77 78add_library(btbb ${LINK_MODE_MODULE} 79 ${PLUGIN_FILES} 80) 81set_target_properties(btbb PROPERTIES PREFIX "") 82set_target_properties(btbb PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") 83 84target_link_libraries(btbb wireshark) 85 86install(TARGETS btbb 87 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ NAMELINK_SKIP 88) 89 90