aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2019-05-03 12:20:47 -0700
committerGerald Combs <gerald@wireshark.org>2019-05-24 17:05:39 +0000
commitdd4c9877560774c9f07c454028027539a562fe1a (patch)
treecf874544ce3cd93d47d17a33c51721c31f78a460 /extcap
parent29283decd7f312e54560cf53398a0809aac37803 (diff)
CMake+macOS: Use symlinks for our CLI utilities.
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>
Diffstat (limited to 'extcap')
-rw-r--r--extcap/CMakeLists.txt15
1 files changed, 8 insertions, 7 deletions
diff --git a/extcap/CMakeLists.txt b/extcap/CMakeLists.txt
index b07b58352c..03b2b0273e 100644
--- a/extcap/CMakeLists.txt
+++ b/extcap/CMakeLists.txt
@@ -62,13 +62,14 @@ macro(set_extcap_executable_properties _executable)
set_target_properties(${_executable} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/extcap
)
- # Add a wrapper script which runs each executable from the
- # correct location. This adds convenience but makes debugging
- # more difficult.
- file(REMOVE ${CMAKE_BINARY_DIR}/run/${_executable})
- file(WRITE ${CMAKE_BINARY_DIR}/run/${_executable} "#!/bin/sh\n")
- file(APPEND ${CMAKE_BINARY_DIR}/run/${_executable} "exec ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/extcap/${_executable} \"\$\@\"\n")
- execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/${_executable})
+ # Create a convenience link from run/<name> to its respective
+ # target in the application bundle.
+ add_custom_target(${_executable}-symlink
+ COMMAND ln -s -f
+ Wireshark.app/Contents/MacOS/${_executable}
+ ${CMAKE_BINARY_DIR}/run/${_executable}
+ )
+ add_dependencies(${_executable} ${_executable}-symlink)
endif()
endif()
endif()