-Wignored-qualifiers
-Wpragmas
-Wno-overlength-strings
- -Wwrite-strings
-Wno-long-long
-Wheader-guard
-Wunused-const-variable
set(WIRESHARK_EXTRA_COMPILER_COMMON_FLAGS
# The following are for C and C++
-Wpedantic
+ #
+ # As we use variadic macros, we don't want warnings
+ # about them, even with -Wpedantic.
+ #
-Wno-variadic-macros
#
# Various code blocks this one.
#
if( NOT CMAKE_C_COMPILER_ID MATCHES "MSVC")
#
- # Try the GCC-and-copatible -fvisibility-hidden first.
+ # Try the GCC-and-compatible -fvisibility-hidden first.
#
check_c_compiler_flag(-fvisibility=hidden FVHIDDEN)
if(FVHIDDEN)
set (C_UNUSED "" )
endif()
-
-if(NOT CMAKE_C_COMPILER_ID MATCHES "MSVC")
- set(WIRESHARK_LD_FLAGS
- -Wl,--as-needed
- # -flto
- # -fwhopr
- # -fwhole-program
+set(WIRESHARK_LD_FLAGS
+ -Wl,--as-needed
+ # -flto
+ # -fwhopr
+ # -fwhole-program
+)
+# CMAKE_POSITION_INDEPENDENT_CODE is only supported starting with CMake
+# 2.8.9. Do not add -pie automatically for older versions.
+#
+# XXX - are there other compilers that don't support -pie? It's
+# not as if the only platforms we support are Windows and Linux....
+#
+if(NOT CMAKE_VERSION VERSION_LESS "2.8.9")
+ set(WIRESHARK_LD_FLAGS ${WIRESHARK_LD_FLAGS}
+ -pie
)
- # CMAKE_POSITION_INDEPENDENT_CODE is only supported starting with CMake
- # 2.8.9. Do not add -pie automatically for older versions.
- #
- # XXX - are there other compilers that don't support -pie? It's
- # not as if the only platforms we support are Windows and Linux....
- #
- if(NOT CMAKE_VERSION VERSION_LESS "2.8.9")
- set(WIRESHARK_LD_FLAGS ${WIRESHARK_LD_FLAGS}
- -pie
- )
- endif()
endif()
include(CheckCLinkerFlag)
# - set HAVE_XXX
#The minimum package list
-set(PACKAGELIST Gettext M GLIB2 GMODULE2 GTHREAD2 LEX YACC Perl SED SH PythonInterp)
+set(PACKAGELIST Gettext M Git GLIB2 GMODULE2 GTHREAD2 LEX YACC Perl SED SH PythonInterp)
set(LEX_REQUIRED TRUE)
set(GLIB2_REQUIRED TRUE)
set(GLIB2_FIND_REQUIRED TRUE)
if (WIN32)
# On Windows we build our own version of zlib, so add the paths
set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.8-ws")
+ set(SKIP_INSTALL_ALL True) # We copy the DLL ourselves.
add_subdirectory("${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
+ unset(SKIP_INSTALL_ALL)
set(ZLIB_INCLUDE_DIR "${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
set(ZLIB_LIBRARY zlib)
set(ZLIB_DLL "zlib1.dll")
add_subdirectory( wsutil )
if(NOT WIN32)
- add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil color.h)
+ add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil)
endif()
if(ENABLE_ECHLD)
set(DATAFILE_DIR ${_datafile_dir} CACHE INTERNAL "Build time data file location.")
-if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
- set(ABSOLUTE_CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
-else()
- set(ABSOLUTE_CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-endif()
-
if(ENABLE_EXTCAP)
+ # Target platform locations
+ # UNIX, Linux, non-bundled OS X: $DESTDIR/lib/wireshark/extcap
+ # Windows: $DESTDIR/extcap
+ # OS X app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap
set(HAVE_EXTCAP 1)
- set(EXTCAP_DIR "${ABSOLUTE_CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap/")
+ if (WIN32)
+ set(EXTCAP_DIR "extcap")
+ else ()
+ set(EXTCAP_DIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap")
+ endif()
endif()
if(LIBSSH_FOUND)
# Location of our plugins. PLUGIN_DIRECTORY should allow running
# from the build directory similar to DATAFILE_DIR above.
if(ENABLE_PLUGINS)
+ # Target platform locations
+ # UNIX, Linux, non-bundled OS X: $DESTDIR/lib/wireshark/plugins/$VERSION
+ # Windows: $DESTDIR/wireshark/plubins/$VERSION
+ # OS X app bundle: Wireshark.app/Contents/PlugIns/wireshark
set(HAVE_PLUGINS 1)
add_custom_target(plugins)
set_target_properties(plugins PROPERTIES FOLDER "Plugins")
- set(PLUGIN_INSTALL_DIR "${ABSOLUTE_CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}")
+ if (WIN32)
+ set(PLUGIN_INSTALL_DIR "plugins/${CPACK_PACKAGE_VERSION}")
+ else ()
+ set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}")
+ endif()
set(PLUGIN_SRC_DIRS
plugins/docsis
plugins/ethercat
set(WS_MSVC_NORETURN " ")
endif()
+if (${GIT_EXECUTABLE})
+ set(GIT_BIN_PARAM "--git-bin ${GIT_EXECUTABLE}")
+endif()
set( VERSION ${PROJECT_VERSION} )
execute_process(
COMMAND ${PERL_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
- --print-vcs
+ --print-vcs ${GIT_BIN_PARAM}
${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE VERSION_H_CONTENT
)
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
#set_target_properties(${CMAKE_BINARY_DIR}/version.h PROPERTIES FOLDER "Auxiliary")
+set( prefix "${CMAKE_INSTALL_PREFIX}" )
+set( exec_prefix "\${prefix}" )
+set( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}" )
+set( includedir "\${prefix}/include" )
+set( plugindir "\${libdir}/wireshark/plugins/${CPACK_PACKAGE_VERSION}" )
+
set(ICON_PATH "${CMAKE_SOURCE_DIR}/image/")
set( IN_FILES
adns_dll.rc
${CMAKE_BINARY_DIR}/mergecap.html
pdml2html.xsl
${CMAKE_BINARY_DIR}/randpkt.html
+ ${CMAKE_BINARY_DIR}/randpktdump.html
${CMAKE_BINARY_DIR}/rawshark.html
${CMAKE_BINARY_DIR}/reordercap.html
services
${CMAKE_BINARY_DIR}/idl2wrs.1
${CMAKE_BINARY_DIR}/mergecap.1
${CMAKE_BINARY_DIR}/randpkt.1
+ ${CMAKE_BINARY_DIR}/androiddump.1
${CMAKE_BINARY_DIR}/rawshark.1
${CMAKE_BINARY_DIR}/reordercap.1
${CMAKE_BINARY_DIR}/sshdump.1
)
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/extcap")
endif()
+set(_help_files
+ help/capture_filters.txt
+ help/capturing.txt
+ help/display_filters.txt
+ help/getting_started.txt
+ help/overview.txt
+)
if(WIN32)
file(TO_NATIVE_PATH "${DATAFILE_DIR}/help" _help_dest_dir)
- file(GLOB _help_files RELATIVE "${CMAKE_SOURCE_DIR}" "help/*.txt")
foreach(_help_file IN LISTS _help_files)
add_custom_command(OUTPUT "${DATAFILE_DIR}/${_help_file}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/${_help_file}")
endforeach()
else()
- list(APPEND DATA_FILES_SRC "help/*.txt")
+ list(APPEND DATA_FILES_SRC ${_help_files})
endif(WIN32)
# Create help/faq.txt when missing
# Install LUA files in staging directory such that LUA can used when Wireshark
# is ran from the build directory. For install targets, see
# epan/wslua/CMakeLists.txt
-if(LUA_FOUND)
+if(LUA_FOUND AND ENABLE_LUA)
set(_lua_files
"${CMAKE_BINARY_DIR}/epan/wslua/init.lua"
"${CMAKE_SOURCE_DIR}/epan/wslua/console.lua"
"${_lua_file}"
)
endforeach()
-endif(LUA_FOUND)
+endif(LUA_FOUND AND ENABLE_LUA)
# doc/*.html handled elsewhere.
# TODO shouldn't this use full (relative) paths instead of glob patterns?
set(WIRESHARK_SRC
capture_info.c
capture_opts.c
- color_filters.c
file.c
fileset.c
summary.c
#message( WARNING "Cannot find libssh, cannot build sshdump" )
endif()
+if(BUILD_randpktdump)
+ set(randpktdump_LIBS
+ wiretap
+ ${GLIB2_LIBRARIES}
+ ${CMAKE_DL_LIBS}
+ )
+ set(randpktdump_FILES
+ extcap/randpktdump.c
+ randpkt-core.c
+ )
+
+ add_executable(randpktdump WIN32 ${randpktdump_FILES})
+ # XXX Shouldn't we add wsutil to randpktdump_LIBS instead?
+ set_extcap_executable_properties(randpktdump)
+ target_link_libraries(randpktdump ${randpktdump_LIBS})
+ install(TARGETS randpktdump RUNTIME DESTINATION ${EXTCAP_DIR})
+endif()
+
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
COMMAND ${PERL_EXECUTABLE}
pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2wrs 1 )
pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/mergecap 1 )
pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/randpkt 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/randpktdump 1 )
pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/rawshark 1 )
pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/reordercap 1 )
pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/sshdump 1 )
idl2wrs.html
mergecap.html
randpkt.html
+ randpktdump.html
rawshark.html
reordercap.html
sshdump.html
${rawshark_FILES}
${dftest_FILES}
${randpkt_FILES}
+ ${randpktdump_FILES}
${text2pcap_CLEAN_FILES}
${mergecap_FILES}
${capinfos_FILES}