cmake: provide generic hidapi pkg-config alias #831
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!831
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/generic-pkg-config-alias"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Provide a generic
hidapi.pcpackage for the selected default backend while continuing to install each enabled backend's own pkg-config package.The generic
pc/hidapi.pc.intemplate now accepts an explicit library name and is reused by both CMake and Autotools. Backend-specific packages are generated from one parameterizedpc/hidapi-backend-specific.pc.intemplate, including dedicatedhidapi-darwin.pcandhidapi-winapi.pcpackages. Autotools preserves the existing package names, descriptions, linker flags, and directconfig.status pc/hidapi-*.pcoutputs for compatibility with existing build systems.Linux CI now verifies that
hidapi.pcis installed and uses a small standalone Autotools consumer to compile and link throughpkg-config hidapiwhen both hidraw and libusb backends are present.Tests:
config.statusregeneration, and the standalone pkg-config consumergit diff --checkand whitespace-insensitive diff auditFixes: #638
Assisted-by: ChatGPT:GPT-5.6-Thinking
Assisted-by: codex:gpt-5.6-sol
Thanks for looking into this!
I'll update this a bit per my taste, to generalize the solution.
Try if this works for you.
@giri256 once you confirm latest changes didn't break anything for your flow - I'll have this merged