diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-01-19 13:33:01 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-01-19 21:50:36 +0000 |
commit | 7c69079fb9fbffeb62271bd1d9f34a561b9b5117 (patch) | |
tree | 2ed17d128c5936a3a36b7b556d7ad9f702d54829 /CMakeLists.txt | |
parent | bea25fa0d43d11ddf4f38c6b15e69a038d0e8467 (diff) |
CMake: Add a pdb_zip_package target.
Add a "pdb_zip_package" target similar to the NMake pdb_zip target.
Change-Id: I23d114a63fa05f722ee90b77ea458d9e496e5bf9
Reviewed-on: https://code.wireshark.org/review/6673
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9003261914..ed40830d05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1263,6 +1263,32 @@ if(WIN32) endif(ZLIB_FOUND) add_dependencies(epan copy_cli_dlls) + + # We have a lot of choices for creating zip archives: + # - 7z, WinZip, etc., which require a separate download+install. + # - Cygwin's zip, which requires Cygwin. + # - "CMake -E tar cz", which creates a tar file. + # - CPack, which requires a CPack configuration. + # - PowerShell via PSCX or System.IO.Compression.FileSystem. + # - Python via zipfile. + # For now, just look for 7z. It's installed on the Windows builders, + # which might be the only systems that use this target. + find_program(ZIP_EXECUTABLE 7z + PATH "$ENV{PROGRAMFILES}/7-Zip" "$ENV{PROGRAMW6432}/7-Zip" + DOC "Path to the 7z utility." + ) + if (NOT "${ZIP_EXECUTABLE}" STREQUAL "ZIP_EXECUTABLE-NOTFOUND") + add_custom_target(pdb_zip_package) + set_target_properties(pdb_zip_package PROPERTIES FOLDER "Packaging") + set(_pdb_zip "${CMAKE_BINARY_DIR}/Wireshark-pdb-${WIRESHARK_TARGET_PLATFORM}-${VERSION}.zip") + file(TO_NATIVE_PATH "${_pdb_zip}" _pdb_zip_win) + add_custom_command(TARGET pdb_zip_package POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove -f "${_pdb_zip}" + COMMAND ${ZIP_EXECUTABLE} a -tzip "${_pdb_zip_win}" *.pdb *.lib + WORKING_DIRECTORY "${_dll_output_dir}" + ) + add_dependencies(pdb_zip_package epan) + endif() endif(WIN32) # Copy ${INSTALL_FILES} and ${INSTALL_DIRS} to ${DATAFILE_DIR} |