From 5db2dc4c0410ace65308cddcc03d1c0cfa4855cf Mon Sep 17 00:00:00 2001 From: nightwalker-87 <15526941+Nightwalker-87@users.noreply.github.com> Date: Thu, 23 Apr 2020 11:03:15 +0200 Subject: [PATCH] cmake replaces 7zip for package extraction The exctraction of the libusb library archive on windows no longer requires an external unarchiver. --- cmake/modules/Find7zip.cmake | 7 ------- cmake/modules/Findlibusb.cmake | 17 +++++------------ 2 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 cmake/modules/Find7zip.cmake diff --git a/cmake/modules/Find7zip.cmake b/cmake/modules/Find7zip.cmake deleted file mode 100644 index 83eb912..0000000 --- a/cmake/modules/Find7zip.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Find7zip.cmake -# Detect 7zip file archiver on Windows systems to extract (zip-)archives - -find_program( - ZIP_EXECUTABLE NAMES 7z.exe p7zip - HINTS "C:\\Program Files\\7-Zip\\" "C:\\Program Files (x86)\\7-Zip\\" -) diff --git a/cmake/modules/Findlibusb.cmake b/cmake/modules/Findlibusb.cmake index 13f70d7..8988200 100644 --- a/cmake/modules/Findlibusb.cmake +++ b/cmake/modules/Findlibusb.cmake @@ -73,7 +73,6 @@ elseif (WIN32) # Windows if (NOT LIBUSB_FOUND OR EXISTS "/etc/debian_version") # Preparations for installing libusb library - find_package(7zip REQUIRED) set(LIBUSB_WIN_VERSION 1.0.23) # set libusb version set(LIBUSB_WIN_ARCHIVE libusb-${LIBUSB_WIN_VERSION}.7z) set(LIBUSB_WIN_ARCHIVE_PATH ${CMAKE_BINARY_DIR}/${LIBUSB_WIN_ARCHIVE}) @@ -92,17 +91,11 @@ elseif (WIN32) # Windows file(MAKE_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER}) - # Extract libusb package - if (${ZIP_EXECUTABLE} MATCHES "p7zip") - execute_process( - COMMAND ${ZIP_EXECUTABLE} -d ${LIBUSB_WIN_ARCHIVE_PATH} - WORKING_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER} - ) - else () - execute_process( - COMMAND ${ZIP_EXECUTABLE} x -y ${LIBUSB_WIN_ARCHIVE_PATH} -o${LIBUSB_WIN_OUTPUT_FOLDER} - ) # <-- Note the absence of a space character following the -o option! - endif () + # Extract libusb package with cmake + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xv ${LIBUSB_WIN_ARCHIVE_PATH} + WORKING_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER} + ) # Find path to libusb library FIND_PATH(