3 # Wireshark - Network traffic analyzer
4 # By Gerald Combs <gerald@wireshark.org>
5 # Copyright 1998 Gerald Combs
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.
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.
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.
25 set(WSUTIL_PLATFORM_FILES
84 ${WSUTIL_PLATFORM_FILES}
88 set(WSUTIL_FILES ${WSUTIL_FILES} ws_mempbrk_sse42.c)
92 set(WSUTIL_FILES ${WSUTIL_FILES} popcount.c)
97 # We assume that APPLE means OS X so that we have the OS X
100 FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
104 ${APPLE_CORE_FOUNDATION_LIBRARY}
105 ${GMODULE2_LIBRARIES}
108 ${WIN_WSOCK32_LIBRARY}
111 set(wsutil_LIBS ${wsutil_LIBS} "ws2_32.lib")
119 set_source_files_properties(
122 COMPILE_FLAGS -Werror
127 # XXX - we're assuming MSVC supports the SSE 4.2 intrinsics and
128 # that other C compilers support them iff they support the
131 # Perhaps we should check whether we can compile something
132 # that uses them, instead, and do something else to figure
133 # out what compiler flag, if any, we need to pass to the
134 # compiler to compile code that uses them.
136 if(NOT CMAKE_C_COMPILER_ID MATCHES "MSVC")
137 set_source_files_properties(
138 ${WSUTIL_SSE42_FILES}
140 COMPILE_FLAGS -msse4.2
145 add_library(wsutil ${LINK_MODE_LIB}
147 ../image/libwsutil.rc
150 add_dependencies(wsutil gitversion)
152 set(FULL_SO_VERSION "0.0.0")
154 set_target_properties(wsutil PROPERTIES
156 COMPILE_DEFINITIONS "WS_BUILD_DLL"
157 LINK_FLAGS "${WS_LINK_FLAGS}"
158 VERSION ${FULL_SO_VERSION} SOVERSION 0
161 if(ENABLE_APPLICATION_BUNDLE)
162 set_target_properties(wsutil PROPERTIES
163 LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Frameworks
169 add_custom_command(OUTPUT libwsutil.abi.tar.gz
170 COMMAND cp ../config.h ${ABICHECK_TMPDIR}/
171 COMMAND ${ABICHECK_COMMAND}
172 COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/abi_dumps/libwsutil/libwsutil_* ${CMAKE_CURRENT_BINARY_DIR}/libwsutil.abi.tar.gz
173 COMMAND rm -rf ${ABICHECK_TMPDIR}/* ${CMAKE_CURRENT_BINARY_DIR}/abi_dumps
174 DEPENDS ${HEADERS} wsutil)
176 target_link_libraries(wsutil ${wsutil_LIBS})
178 if(NOT ${ENABLE_STATIC})
179 install(TARGETS wsutil
180 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
181 RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
182 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
186 add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" )
189 # Editor modelines - http://www.wireshark.org/tools/modelines.html
194 # indent-tabs-mode: t
197 # vi: set shiftwidth=8 tabstop=8 noexpandtab:
198 # :indentSize=8:tabSize=8:noTabs=false: