Skip to content

Commit

Permalink
cmake replaces 7zip for package extraction
Browse files Browse the repository at this point in the history
The exctraction of the libusb library archive on windows no longer 
requires an external unarchiver.
  • Loading branch information
Nightwalker-87 committed Apr 23, 2020
1 parent 9373f13 commit 5db2dc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
7 changes: 0 additions & 7 deletions cmake/modules/Find7zip.cmake

This file was deleted.

17 changes: 5 additions & 12 deletions cmake/modules/Findlibusb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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(
Expand Down

0 comments on commit 5db2dc4

Please sign in to comment.