xref: /libbtbb/wireshark/plugins-legacy/btatt/CMakeLists.txt (revision 25d64f63a355f4c01d10cf4f69da1c2246b040d9)
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(btatt-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-btatt.c
51)
52
53set(PLUGIN_FILES
54	plugin.c
55	${DISSECTOR_SRC}
56)
57
58set(CLEAN_FILES
59	${PLUGIN_FILES}
60)
61
62if (WERROR)
63	set_source_files_properties(
64		${CLEAN_FILES}
65		PROPERTIES
66		COMPILE_FLAGS -Werror
67	)
68endif()
69
70include_directories(${CMAKE_CURRENT_SOURCE_DIR})
71
72register_dissector_files(plugin.c
73	plugin
74	${DISSECTOR_SRC}
75)
76
77add_library(btatt ${LINK_MODE_MODULE}
78	${PLUGIN_FILES}
79)
80set_target_properties(btatt PROPERTIES PREFIX "")
81set_target_properties(btatt PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
82
83target_link_libraries(btatt wireshark)
84
85install(TARGETS btatt
86	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ NAMELINK_SKIP
87)
88
89