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