aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2019-09-10CMake: Fix extcap symlinks on macOS.Gerald Combs1-1/+1
Change-Id: I39b1ad1114ba7c8932786aab633d9df133e7ef4d Reviewed-on: https://code.wireshark.org/review/34496 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-24CMake+macOS: Use symlinks for our CLI utilities.Gerald Combs1-7/+8
On macOS, <build directory>/run/wireshark is a wrapper script that execs run/Wireshark.app/Contents/MacOS/Wireshark so that Launch Services will activate our application properly. We don't need to worry about this for our other executables. Make them symlinks so that we can run things like `lldb run/tshark` with impunity. Change-Id: I4e656d778040ece722f873b1a7f6e6e60d21e2a6 Reviewed-on: https://code.wireshark.org/review/33071 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-03CMake: Add libpcap imported library targetJoão Valverde1-1/+1
Change-Id: I5326b87784817fb353329e2d686fe0515c32f6cb Reviewed-on: https://code.wireshark.org/review/33038 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2019-05-02Move the Winsock initialization and cleanup to wsutil routines.Guy Harris1-0/+2
Those routines exist on both Windows and UN*X, but they don't do anything on UN*X (they could if it were ever necessary). That eliminates some #ifdefs, and also means that the gory details of initializing Winsock, including the Winsock version being requested, are buried in one routine. The initialization routine returns NULL on success and a pointer to a g_malloc()ated error message on failure; report the error to the user, along with a "report this to the Wireshark developers" suggestion. That means including wsutil/socket.h, which obviates the need to include some headers for socket APIs, as it includes them for you. Change-Id: I9327bbf25effbb441e4217edc5354a4d5ab07186 Reviewed-on: https://code.wireshark.org/review/33045 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-01Windows: Modernize our WSAStartup usage.Gerald Combs1-0/+6
Make sure we link each application that calls WSAStartup with ws2_32.lib. Pass version 2.2 to WSAStartup. Wikipedia says it was introduced in 1996, so we should be OK. Ping-Bug: 15711 Change-Id: I431839e930e7c646669af7373789640b5180ec28 Reviewed-on: https://code.wireshark.org/review/33033 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-31CMake: rewrite FindSystemd.cmake filePeter Wu1-3/+0
Clarify that this is only needed for the sdjournal extcap interface and report the found version in the CMake output. Change-Id: I40bc540631bda32d0b92e4fcd59d8c1726606d86 Reviewed-on: https://code.wireshark.org/review/31834 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-23CMake: fix failure to locate zlib (and possibly libssh)Peter Wu1-2/+6
Include directories are no longer globally included, be explicit with the required include directories or else function checks will fail. Change-Id: I72d88f94854fcfe6529554f84e49d1dba696e9df Fixes: v2.9.1rc0-436-ga3991874eb ("CMake: Replace PACKAGELIST magic") Reviewed-on: https://code.wireshark.org/review/31693 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-22extcap: remove dependencies from ui.Dario Lombardo1-2/+0
ui is required by randpkt_core, move it to its deps. Bug: 15401 Change-Id: Ia8cfaddd220a22c1cf03ec6bf8f83f068f8d94ba Reviewed-on: https://code.wireshark.org/review/31670 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-01-22CMake: Set a direct rpath for librariesJoão Valverde1-9/+5
Instead of using "$ORIGIN/../lib" just use "$ORIGIN". Also be explicit in configuring the relative RPATH. We don't want to assume a default relative path, in case more targets are addded, out of caution. Change-Id: I3b7f5e8de7be8bb30aca3b433212113d876c4163 Reviewed-on: https://code.wireshark.org/review/31647 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20CMake: do not set RPATH when installing to a system directoryPeter Wu1-2/+3
When built with -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib (as is done by many Linux distributions), do not set an unnecessary RPATH. This was the case before v2.9.0rc0-2727-g697623411c. Relocatable builds will still be possible with the default options as /usr/local/lib is typically not considered a system library path. Change-Id: Ic6ff1760183c20d3f9f9fb787604e888e116534e Reviewed-on: https://code.wireshark.org/review/31602 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20CMake: Replace PACKAGELIST magicJoão Valverde1-3/+9
This is more explicit and easier to read with slightly better locality while using less code. Also less awkward when the package doesn't fit the narrow package list expectations. The ws_find_package() macro doesn't include all the status messages. The choice was to rely on standard find_package() and feature_summary() output and be less verbose. Avoid polluting the CLI build interface. Per target include paths and macro definitions are preferred. Because this patch intentionally removes the global CMAKE_*_FLAGS and include_directories() usage in favor of target properties, some untested build configurations may inadvertently break because of missing ${PACKAGE}_INCLUDE_DIRS or ${PACKAGE}_DEFINITIONS. This required a manual review of dependencies that might have been incomplete. ${PACKAGE_VAR}_LINK_FLAGS seems to be unused. Changing the CMake Qt code to use more modern CMake component syntax is left as future work. Change-Id: I3ed75252189a6e05a23ed6e619088f519cd7ed78 Reviewed-on: https://code.wireshark.org/review/31496 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-12CMake: use object libraries to avoid redundant buildsPeter Wu1-20/+31
Some source files are duplicated via add_executable. Assuming that these are not affected by target-specific preprocessor macros, they can be built only once and shared among executables. In one configuration, this reduces the number of object files by 55 (cli_main.c and version_info.c alone were built 15 times each). Removes the version dependency from each target since the 'version_info' target can now declare this dependency. Remove CLEAN_C_FILES from extcap since it is not used to set -Werror. Due to removing some files from wireshark_FILES (and others), these are no longer part of checkAPIs though. Hopefully that is acceptable. Change-Id: I0a3f1ffb950e70a6176c96d867f694fbc6476f58 Reviewed-on: https://code.wireshark.org/review/31509 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-05Remove comment whose meaning is unclear at best.Guy Harris1-2/+0
What is is it saying we shouldn't be doing? Change-Id: Iad26687f3f3f482af09760255fef7189ed71a3ae Reviewed-on: https://code.wireshark.org/review/31391 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-13Put the main() and wmain() routines for CLI programs into a separate file.Guy Harris1-0/+5
That means that code is only in one place, rather than having copies of it in each of those programs. CLI programs that, on Windows, should get UTF-8 arguments rather than arguments in the local code page should: include the top-level cli_main.h header; define the main function as real_main(); be built with the top-level cli_main.c file. On UN*X, cli_main.c has a main() program, and just passes the arguments on to real_main(). On Windows, cli_main.c has a wmain() function that converts the UTF-16 arguments it's handed to UTF-8 arguments, using WideCharToMultiByte() so that it doesn't use any functions other than those provided by the system, and then calls real_main() with the argument count and UTF-8 arguments. Change-Id: I8b11f01dbc5c63fce599d1bef9ad96cd92c3c01e Reviewed-on: https://code.wireshark.org/review/31017 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-03CMake: Use $ORIGIN with RPATHJoão Valverde1-0/+5
Make our package relocatable on Unix systems. Linux, Solaris and FreeBSD are known to support $ORIGIN. Change-Id: Ibcdda33d62c075bfa867d006cb6aaf5824609011 Reviewed-on: https://code.wireshark.org/review/30896 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-10-12Win32: Make extcap utilities console applications.Gerald Combs1-7/+7
Switch from using WinMain in extcap to wmain. Change-Id: I54fafad598f5ff74fe84a3ce3e993ac5a31188f7 Reviewed-on: https://code.wireshark.org/review/30094 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-10Windows: Make our program details more consistent.Gerald Combs1-0/+7
Use a single template file for most of our program resources. Encode our resource files as UTF-8. Add resources to extcap/*.exe. Replace a regex with concatenation. Change-Id: I0ed49086618127ca4fdef69272f849d8f16e4dab Reviewed-on: https://code.wireshark.org/review/30088 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-10-01Add a systemd Journal Export extcap.Gerald Combs1-0/+25
Add an sdjournal extcap, which reads journal entries using the sd-journal API and dumps them as journal Export Format records. Change-Id: I17ccfa88ab5d053c16c869cd26e580d84022502e Reviewed-on: https://code.wireshark.org/review/29479 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-23CMake: Clean up and homogenize plugin dir configurationJoão Valverde1-7/+7
Change-Id: If43c7b124afdf6471164675f8a0c55a76e998ea1 Reviewed-on: https://code.wireshark.org/review/29254 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-08-22Revert "CMake: Clean up plugin dirs"João Valverde1-7/+7
Broke system (global) binary plugin path. This reverts commit 450ff674a6e84c3abebff76a470d72114083f27f. Change-Id: I5353d2f3acf4450aed243040ef71425a71542a08 Reviewed-on: https://code.wireshark.org/review/29240 Reviewed-by: João Valverde <j@v6e.pt>
2018-08-21CMake: Clean up plugin dirsJoão Valverde1-7/+7
Change-Id: Ie41366205db19b8a9714ad5259c3f958e1e9ee95 Reviewed-on: https://code.wireshark.org/review/29233 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-06-21Fix build paths for cmake's Xcode project generator on macOS.David Kreitschmann1-10/+17
Multi-configuration generators (such as Xcode or VS) append the current build configuration to most paths (eg. Debug/Release). Currently this results in inconsistent paths for the application bundle and the included command line tools. This commit sets the correct path information for multi-configuration generators for macOS application bundles. The standard Makefile behaviour is untouched. One Windows specific configuration was changed, as it was conflicting with these changes. This needs to be checked before merging. Additionally the wrapper scripts are omitted for Xcode, as the path to the binaries depends on the configuration chosen in Xcode. Therefore it is not viable to create these scripts in the cmake run. Bug: 11816 Change-Id: Ib43d82eb04600a0e2f2b020afb44b579ffc7a7c9 Reviewed-on: https://code.wireshark.org/review/28291 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-24extcap: set EXTCAP_DIR in the root cmake file and propagate it.Dario Lombardo1-11/+0
The EXTCAP_DIR must be known in the root file to be set in config.h and it's still needed in extcap/ to install the binaries, hence we need caching it as well. Bug: 14724 Change-Id: I58bac7de7a00e06c23fe8c8f1a7e3d299de6a560 Reviewed-on: https://code.wireshark.org/review/27776 Reviewed-by: Mikael Kanstrup <mikael.kanstrup@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-19cmake: move extcap sections to extcap/CMakeLists.txt.Dario Lombardo1-0/+226
Change-Id: Ie7d9f6ad3d8b788e0d22e3ce15159fc46f5a93e8 Reviewed-on: https://code.wireshark.org/review/27638 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>