Remove U3 code and packaging.
[metze/wireshark/wip.git] / wsutil / CMakeLists.txt
1 # CMakeLists.txt
2 #
3 # $Id$
4 #
5 # Wireshark - Network traffic analyzer
6 # By Gerald Combs <gerald@wireshark.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #
23
24 include(UseABICheck)
25
26 IF(WIN32)
27   set(WSUTIL_PLATFORM_FILES
28     file_util.c
29     inet_aton.c
30     inet_ntop.c
31     inet_pton.c
32     strptime.c
33     unicode-utils.c
34     wsgetopt.c
35   )
36 ENDIF(WIN32)
37
38 set(WSUTIL_FILES
39   aes.c
40   airpdcap_wep.c
41   crash_info.c
42   crc10.c
43   crc16.c
44   crc16-plain.c
45   crc32.c
46   crc6.c
47   crc7.c
48   crc8.c
49   crc11.c
50   crcdrm.c
51   des.c
52   eax.c
53   g711.c
54   md4.c
55   md5.c
56   mpeg-audio.c
57   nstime.c
58   privileges.c
59   sha1.c
60   strnatcmp.c
61   str_util.c
62   rc4.c
63   report_err.c
64   swar.c
65   tempfile.c
66   type_util.c
67   ${WSUTIL_PLATFORM_FILES}
68 )
69
70 set(wsutil_LIBS
71   ${GMODULE2_LIBRARIES}
72   ${GLIB2_LIBRARIES}
73   ${GCRYPT_LIBRARIES}
74   ${WIN_WSOCK32_LIBRARY}
75 )
76 IF(WIN32)
77   set(wsutil_LIBS ${wsutil_LIBS} "ws2_32.lib")
78 ENDIF(WIN32)
79
80 set(CLEAN_FILES
81   ${WSUTIL_FILES}
82 )
83
84 if (WERROR)
85   set_source_files_properties(
86     ${CLEAN_FILES}
87     PROPERTIES
88     COMPILE_FLAGS -Werror
89   )
90 endif()
91
92 add_library(wsutil ${LINK_MODE_LIB}
93   ${WSUTIL_FILES}
94 )
95
96 set(FULL_SO_VERSION "0.0.0")
97
98 set_target_properties(wsutil PROPERTIES COMPILE_DEFINITIONS "WS_BUILD_DLL")
99 set_target_properties(wsutil PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
100 set_target_properties(wsutil PROPERTIES VERSION ${FULL_SO_VERSION} SOVERSION 0)
101 set_target_properties(wsutil PROPERTIES FOLDER "DLLs")
102
103 ABICHECK(libwsutil)
104
105 add_custom_command(OUTPUT libwsutil.abi.tar.gz
106         COMMAND cp ../config.h ${ABICHECK_TMPDIR}/
107         COMMAND ${ABICHECK_COMMAND}
108         COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/abi_dumps/libwsutil/libwsutil_* ${CMAKE_CURRENT_BINARY_DIR}/libwsutil.abi.tar.gz
109         COMMAND rm -rf ${ABICHECK_TMPDIR}/* ${CMAKE_CURRENT_BINARY_DIR}/abi_dumps
110         DEPENDS ${HEADERS} wsutil)
111
112 target_link_libraries(wsutil ${wsutil_LIBS})
113
114 if(NOT ${ENABLE_STATIC})
115         install(TARGETS wsutil
116                 LIBRARY DESTINATION lib
117                 RUNTIME DESTINATION lib
118                 ARCHIVE DESTINATION lib
119         )
120 endif()
121