Fix Uninitialized argument value found by Clang Analyzer
[metze/wireshark/wip.git] / wiretap / 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(UseABICheck)
23
24 set(CLEAN_FILES
25         5views.c
26         aethra.c
27         ascendtext.c
28         atm.c
29         ber.c
30         btsnoop.c
31         buffer.c
32         camins.c
33         catapult_dct2000.c
34         commview.c
35         cosine.c
36         csids.c
37         daintree-sna.c
38         dbs-etherwatch.c
39         dct3trace.c
40         erf.c
41         eyesdn.c
42         file_access.c
43         file_wrappers.c
44         hcidump.c
45         i4btrace.c
46         ipfix.c
47         iptrace.c
48         iseries.c
49         k12.c
50         lanalyzer.c
51         libpcap.c
52         logcat.c
53         merge.c
54         mpeg.c
55         mime_file.c
56         mp2t.c
57         netmon.c
58         netscaler.c
59         netscreen.c
60         nettl.c
61         network_instruments.c
62         netxray.c
63         ngsniffer.c
64         packetlogger.c
65         pcap-common.c
66         pcapng.c
67         peekclassic.c
68         peektagged.c
69         pppdump.c
70         radcom.c
71         snoop.c
72         stanag4607.c
73         tnef.c
74         toshiba.c
75         visual.c
76         vms.c
77         vwr.c
78         wtap.c
79 )
80
81 set(DIRTY_FILES
82 )
83
84 set(WIRETAP_FILES
85         ${CLEAN_FILES}
86         ${DIRTY_FILES}
87 )
88
89 if (WERROR)
90         set_source_files_properties(
91                 ${CLEAN_FILES}
92                 PROPERTIES
93                 COMPILE_FLAGS -Werror
94         )
95 endif()
96
97 add_lex_files(WIRETAP_FILES
98         ascend_scanner.l
99         k12text.l
100 )
101
102 add_yacc_files(WIRETAP_FILES
103         ascend.y
104 )
105
106 set(wiretap_LIBS
107         ${GLIB2_LIBRARIES}
108         ${GMODULE2_LIBRARIES}
109         ${ZLIB_LIBRARIES}
110         wsutil
111 )
112
113 add_library(wiretap ${LINK_MODE_LIB}
114         ${WIRETAP_FILES}
115         ../image/wiretap.rc
116 )
117
118 set(FULL_SO_VERSION "0.0.0")
119
120 set_target_properties(wiretap PROPERTIES COMPILE_DEFINITIONS "WS_BUILD_DLL")
121 set_target_properties(wiretap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
122 set_target_properties(wiretap PROPERTIES VERSION ${FULL_SO_VERSION} SOVERSION 0)
123 set_target_properties(wiretap PROPERTIES FOLDER "DLLs")
124
125 ABICHECK(libwiretap)
126
127 add_custom_command(OUTPUT libwiretap.abi.tar.gz
128         COMMAND cp ../config.h ${ABICHECK_TMPDIR}/
129         COMMAND ${ABICHECK_COMMAND}
130         COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/abi_dumps/libwiretap/libwiretap_* ${CMAKE_CURRENT_BINARY_DIR}/libwiretap.abi.tar.gz
131         COMMAND rm -rf ${ABICHECK_TMPDIR}/* ${CMAKE_CURRENT_BINARY_DIR}/abi_dumps
132         DEPENDS ${HEADERS} wiretap)
133
134 target_link_libraries(wiretap ${wiretap_LIBS})
135
136 if(NOT ${ENABLE_STATIC})
137         install(TARGETS wiretap
138                 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
139                 RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
140                 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
141         )
142 endif()
143