-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nick D'Ademo <[email protected]> Co-authored-by: Kai Pastor <[email protected]>
- Loading branch information
1 parent
a01cae2
commit 4d84733
Showing
6 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
if(NOT TARGET unofficial::libusbp::libusbp) | ||
add_library(unofficial::libusbp::libusbp UNKNOWN IMPORTED) | ||
|
||
set_target_properties(unofficial::libusbp::libusbp PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/libusbp-1" | ||
) | ||
|
||
find_library(libusbp_LIBRARY_RELEASE NAMES usbp-1 PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) | ||
if(EXISTS "${libusbp_LIBRARY_RELEASE}") | ||
set_property(TARGET unofficial::libusbp::libusbp APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release") | ||
set_target_properties(unofficial::libusbp::libusbp PROPERTIES IMPORTED_LOCATION_RELEASE "${libusbp_LIBRARY_RELEASE}") | ||
endif() | ||
|
||
find_library(libusbp_LIBRARY_DEBUG NAMES usbp-1 PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) | ||
if(EXISTS "${libusbp_LIBRARY_DEBUG}") | ||
set_property(TARGET unofficial::libusbp::libusbp APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug") | ||
set_target_properties(unofficial::libusbp::libusbp PROPERTIES IMPORTED_LOCATION_DEBUG "${libusbp_LIBRARY_DEBUG}") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
message( | ||
"${PORT} currently requires the following libraries from the system package manager: | ||
libudev-dev | ||
These can be installed on Ubuntu systems via sudo apt install libudev-dev" | ||
) | ||
endif() | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO pololu/libusbp | ||
REF "${VERSION}" | ||
SHA512 3705ab40b65323eab788592b1b5e1cd94ef1d7ee55fb0f2919013a8bdb488eb83e257623a8be8c5230a74eaea1c0fd8a5926a8a399f0d2f6eebcd82ec0a01c4d | ||
HEAD_REF master | ||
) | ||
|
||
vcpkg_find_acquire_program(PKGCONFIG) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" | ||
) | ||
|
||
vcpkg_cmake_install() | ||
vcpkg_copy_pdbs() | ||
|
||
vcpkg_fixup_pkgconfig() | ||
|
||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin") | ||
endif() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
||
configure_file("${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" @ONLY) | ||
|
||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
libusbp provides pkg-config modules: | ||
|
||
# Library for accessing USB devices. | ||
libusbp | ||
|
||
libusbp provides CMake targets: | ||
|
||
find_package(unofficial-libusbp CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE unofficial::libusbp::libusbp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "libusbp", | ||
"version": "1.3.1", | ||
"description": "The Pololu USB Library (also known as libusbp) is a cross-platform C library for accessing USB devices.", | ||
"homepage": "https://github.com/pololu/libusbp", | ||
"license": "MIT", | ||
"supports": "!android & !uwp", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "daf8ebcc9f66cd78734a4cc0f7cc9234f925d3f3", | ||
"version": "1.3.1", | ||
"port-version": 0 | ||
} | ||
] | ||
} |