[libusb-win32] add version 1.2.6.0

This commit is contained in:
Mikhail Paulyshka 2017-05-17 04:24:27 +03:00
parent e66d5f46c7
commit 5d6d76323c
3 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.0)
project(libusb-win32)
set(lib_headers src/lusb0_usb.h)
set(lib_srcs src/descriptors.c
src/error.c
src/install.c
src/registry.c
src/usb.c
src/windows.c
libusb0.def)
add_library(libusb0 ${lib_srcs})
target_include_directories(libusb0 PRIVATE "src/driver")
target_link_libraries(libusb0 Setupapi)
target_compile_definitions(libusb0 PRIVATE "-D_CRT_SECURE_NO_WARNINGS")
install(
TARGETS libusb0
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(
FILES ${lib_headers}
DESTINATION include)

View File

@ -0,0 +1,3 @@
Source: libusb-win32
Version: 1.2.6.0
Description: Allows user space applications to access many USB device on Windows.

View File

@ -0,0 +1,31 @@
include(vcpkg_common_functions)
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
message(FATAL_ERROR "Error: UWP builds are currently not supported.")
endif()
set(LIBUSB_VERSION 1.2.6.0)
set(LIBUSB_HASH 972438b7465a22882bc91a1238291240ee3cdb09f374454a027d003b150656d4c262553104f74418bb49b4a7ca2f1a4f72d20e689fa3a7728881bafc876267f4)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libusb-win32-src-${LIBUSB_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/${LIBUSB_VERSION}/libusb-win32-src-${LIBUSB_VERSION}.zip/download"
FILENAME "libusb-win32-${LIBUSB_VERSION}.zip"
SHA512 ${LIBUSB_HASH}
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA)
vcpkg_build_cmake()
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(COPY ${SOURCE_PATH}/COPYING_LGPL.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/libusb-win32)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libusb-win32/COPYING_LGPL.txt ${CURRENT_PACKAGES_DIR}/share/libusb-win32/copyright)