diff options
author | David Kreitschmann <dkreitschmann@seemoo.tu-darmstadt.de> | 2018-06-15 12:44:47 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-06-21 03:33:03 +0000 |
commit | 11ba10dd4b8865d1d4b866cd808ec8fe4defe3b2 (patch) | |
tree | 2ff94017b1d563c78bae94cb5266c94137617d9e /extcap | |
parent | 17604f15a1a1fe4199449150675c2613874ae4a5 (diff) |
Fix build paths for cmake's Xcode project generator on macOS.
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>
Diffstat (limited to 'extcap')
-rw-r--r-- | extcap/CMakeLists.txt | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/extcap/CMakeLists.txt b/extcap/CMakeLists.txt index 242f66d434..0e8c95d69e 100644 --- a/extcap/CMakeLists.txt +++ b/extcap/CMakeLists.txt @@ -47,16 +47,23 @@ macro(set_extcap_executable_properties _executable) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/extcap ) if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(${_executable} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY 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}) + if(NOT CMAKE_CFG_INTDIR STREQUAL ".") + # Xcode + set_target_properties(${_executable} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/MacOS/extcap + ) + else() + 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}) + endif() endif() endif() endmacro() |