CMake: Set an output directory for plugins.
[metze/wireshark/wip.git] / plugins / ethercat / CMakeLists.txt
1 # CMakeLists.txt
2 #
3 # Wireshark - Network traffic analyzer
4 # By Gerald Combs <gerald@wireshark.org>
5 # Copyright 1998 Gerald Combs
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21
22 include(WiresharkPlugin)
23
24 # This info is from moduleinfo.nmake
25 set_module_info(ethercat 0 1 0 0)
26
27 set(DISSECTOR_SRC
28         packet-ams.c
29         packet-ecatmb.c
30         packet-esl.c
31         packet-ethercat-datagram.c
32         packet-ethercat-frame.c
33         packet-ioraw.c
34         packet-nv.c
35 )
36
37 set(PLUGIN_FILES
38         plugin.c
39         ${DISSECTOR_SRC}
40 )
41
42 set(CLEAN_FILES
43         ${PLUGIN_FILES}
44 )
45
46 if (WERROR)
47         set_source_files_properties(
48                 ${CLEAN_FILES}
49                 PROPERTIES
50                 COMPILE_FLAGS -Werror
51         )
52 endif()
53
54 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
55
56 register_dissector_files(plugin.c
57         plugin
58         ${DISSECTOR_SRC}
59 )
60
61 add_plugin_library(ethercat)
62
63 install(TARGETS ethercat
64         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP
65         RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}
66         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}
67 )