From 46561910f4372ac9fc591bb225298bee7e2879b8 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 28 Jun 2016 10:35:27 -0700 Subject: CMake: Update the macOS wrapper script behavior. CMake on macOS creates a convenience wrapper (run/wireshark) that runs run/Wireshark.app/Contents/MacOS/Wireshark. Have it run the executable using "exec" instead of opening the bundle using "open" so that Wireshark runs in the foreground. Change-Id: I295ce0681da75678e5e01781e9c8fb58e2236fc9 Reviewed-on: https://code.wireshark.org/review/16196 Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs --- CMakeLists.txt | 3 ++- README.cmake | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8c7bd5a29..c79ee445fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1844,7 +1844,8 @@ if(BUILD_wireshark AND QT_FOUND) # convenience but makes debugging more difficult. file(REMOVE ${CMAKE_BINARY_DIR}/run/wireshark) file(WRITE ${CMAKE_BINARY_DIR}/run/wireshark "#!/bin/sh\n") - file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "open ${CMAKE_BINARY_DIR}/run/Wireshark.app --args \"\$\@\"\n") + file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "# Generated by ${CMAKE_CURRENT_LIST_FILE}\n") + file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "exec ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/Wireshark \"\$\@\"\n") execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/wireshark) endif() diff --git a/README.cmake b/README.cmake index 5d798f5697..5ac018c651 100644 --- a/README.cmake +++ b/README.cmake @@ -117,6 +117,9 @@ How to do an out of tree build using Visual C++ 2013: build dir and start form step 2) again. 6) The executables can be run from the appropriate directory, e.g. run\RelWithDebInfo for VS solutions or run\ for NMake files. + On macOS CMake creates an application bundle by default and places executables in + run/Wireshark.app/Contents/MacOS. It also creates a convenience wrapper script + (run/wireshark) which will run the Wireshark executable in the bundle. 7) To build an installer, build the nsis_package_prep and then the nsis_package projects, e.g. msbuild /m /p:Configuration=RelWithDebInfo nsis_package_prep.vcxproj msbuild /m /p:Configuration=RelWithDebInfo nsis_package.vcxproj -- cgit v1.2.1