INCLUDEPATH += $$HIDAPIDIR/hidapi
-linux {
- SOURCES += $$HIDAPIDIR/libusb/hid.c
- CONFIG += link_pkgconfig
- PKGCONFIG += libusb-1.0
-}
-win32 {
+CONFIG += link_pkgconfig
+
+packagesExist(hidapi-hidraw) {
+ PKGCONFIG += hidapi-hidraw
+ message("Pkg-Config: using HIDAPI with HIDraw interface")
+} else {
+ packagesExist(hidapi) {
+ PKGCONFIG += hidapi
+ message("Pkg-Config: using HIDAPI with default interface")
+ } else {
+ packagesExist(hidapi-libusb) {
+ PKGCONFIG += hidapi-libusb
+ message("Pkg-Config: using HIDAPI with libusb interface")
+ } else {
+ linux {
+ SOURCES += $$HIDAPIDIR/linux/hid.c
+ message("Using built-in HIDAPI for Linux")
+ }
+ win32 {
SOURCES += $$HIDAPIDIR/windows/hid.c
LIBS += -lsetupapi
-}
-mac {
+ message("Using built-in HIDAPI for Windows")
+ }
+ mac {
SOURCES += $$HIDAPIDIR/mac
#from mac/Makefile-manual, not sure how to use this:
#LIBS += -framework IOKit -framework CoreFoundation
+ message("Using built-in HIDAPI for MacOS/X")
+ }
+ }
+ }
}
--- /dev/null
+TEMPLATE = lib
+TARGET = msp-fido-u2f
+CONFIG += plugin no_plugin_name_prefix
+
+include (../../basics.pri)
+include (../../src/smoke.pri)
+
+#SOURCES += bcs-plugin.cpp configwidget.cpp bcskeyboard.cpp hidscanner.cpp
+#HEADERS += bcs-plugin.h configwidget.h bcskeyboard.h hidscanner.h
+
+CONFIG += link_pkgconfig
+
+packagesExist(u2f-host u2f-server) {
+ PKGCONFIG += u2f-host u2f-server
+ message("Pkg-Config: U2F libs found")
+} else {
+ error("Pkg-Config: U2F libs not found!")
+}