diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-04-13 17:11:15 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-04-15 20:26:13 +0000 |
commit | 40ce324f4d0beda62a957f5f6c47dcc9ac5c5c18 (patch) | |
tree | c20e9a349a21b8e77e7d95420b0954550e17a51c /CMakeLists.txt | |
parent | 05c0152370cbe084193ad2946e6fc96a1017c08e (diff) | |
download | wireshark-40ce324f4d0beda62a957f5f6c47dcc9ac5c5c18.tar.gz |
Set the extcap working directory on Windows.
On Windows, prepend the main program directory to %Path% when spawning
extcap processes. This lets us place androiddump in extcap while allowing
it to locate its DLLs.
Change-Id: I406c47ce71323266d5f14fb596931398464e452d
Reviewed-on: https://code.wireshark.org/review/8057
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ac850c136..cd3a360079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1765,6 +1765,25 @@ macro(set_extra_executable_properties _executable _folder) endif() endmacro() +macro(set_extcap_executable_properties _executable) + set_target_properties(androiddump PROPERTIES FOLDER "Executables/Extcaps") + + set(PROGLIST ${PROGLIST} ${_executable}) + + if(WIN32) + set_target_properties(${_executable} PROPERTIES + LINK_FLAGS "${WS_LINK_FLAGS} /SUBSYSTEM:WINDOWS" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/extcap + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/run/Debug/extcap + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/run/Release/extcap + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/run/MinSizeRel/extcap + RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/run/RelWithDebInfo/extcap + ) + else() + set_target_properties(${_executable} PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") + endif() +endmacro() + if(BUILD_wireshark_gtk AND GTK_FOUND) set(wireshark_gtk_LIBS gtkui @@ -2172,19 +2191,11 @@ if(BUILD_androiddump) extcap/androiddump.c ) - set(COPY_CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/extcap) add_executable(androiddump ${androiddump_FILES}) add_dependencies(androiddump gitversion) - if(WIN32) - set_target_properties(androiddump PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS} /SUBSYSTEM:WINDOWS") - else() - set_target_properties(androiddump PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") - endif() - set_target_properties(androiddump PROPERTIES FOLDER "Executables/Extcaps") + set_extcap_executable_properties(androiddump) target_link_libraries(androiddump ${androiddump_LIBS}) install(TARGETS androiddump RUNTIME DESTINATION ${EXTCAP_DIR}) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${COPY_CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif() ADD_CUSTOM_COMMAND( |