diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-04-15 14:34:58 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-04-15 22:19:47 +0000 |
commit | 8d9fdda9913a4773ebaf4fc34401ae8a24b729d7 (patch) | |
tree | f2dc92464c21ae6fcd08c1edfd6441d3d6db2b1a /CMakeLists.txt | |
parent | f026088ca9e97ea003baf46801acfb426ea0b494 (diff) |
CMake: Try not to clobber our gspawn exes.
Try not to overwrite gspawn*.exe between signing them and packaging them.
Change-Id: I9f224b64537c3b0dd6f7f8b94a8837bd427ad2ca
Reviewed-on: https://code.wireshark.org/review/8080
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd3a360079..2fb149c56f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1271,14 +1271,16 @@ if(WIN32) endforeach(_dll) + # Don't overwrite an exe if it's already there. We don't want to + # clobber any previous code signing. file(GLOB _gspawn_helpers + RELATIVE "${GLIB2_DLL_DIR}" "${GLIB2_DLL_DIR}/gspawn*.exe" ) foreach(_gspawn_helper ${_gspawn_helpers}) add_custom_command(TARGET copy_cli_dlls PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${_gspawn_helper}" - "${_dll_output_dir}" + COMMAND if not exist \"${_dll_output_dir_win}\\${_gspawn_helper}\" xcopy ${_gspawn_helper} "${_dll_output_dir_win}" /D /Y + WORKING_DIRECTORY "${GLIB2_DLL_DIR}" ) endforeach() @@ -1765,25 +1767,6 @@ 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 @@ -2191,11 +2174,19 @@ 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) - set_extcap_executable_properties(androiddump) + 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") 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( |