summaryrefslogtreecommitdiff
path: root/cmake/FindPCSCLite.cmake
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-12-09 14:11:41 +0100
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2022-02-10 18:14:40 +0100
commit44d474a0fc1a2b6352c5cb83d389aa129e9f09c4 (patch)
tree188f3677a7f4a51dcbdde56e0439de81fc7200a1 /cmake/FindPCSCLite.cmake
parente27c6600eca2c9b704c73a0b6d28780eb236cefb (diff)
downloadqtconnectivity-44d474a0fc1a2b6352c5cb83d389aa129e9f09c4.tar.gz
QtNFC: Add PSCSLite/winscard backend
This backend allows to use the QtNFC API with smart card readers on Linux, macOS and Windows. This backend currently supports NDEF access only for Type 4 tags, but a framework is provided that can be used to extend this support to other tags. [ChangeLog][QtNfc][Platform Specific Changes] Added support for accessing smartcards using readers supporting PC/SC specification on Linux, macOS and Windows. Fixes: QTBUG-97946 Change-Id: I9abd7d5aeae67c7a633200131db9b90573d5f3df Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'cmake/FindPCSCLite.cmake')
-rw-r--r--cmake/FindPCSCLite.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/FindPCSCLite.cmake b/cmake/FindPCSCLite.cmake
new file mode 100644
index 00000000..644c89b1
--- /dev/null
+++ b/cmake/FindPCSCLite.cmake
@@ -0,0 +1,18 @@
+if(WIN32)
+ add_library(PkgConfig::PCSCLITE INTERFACE IMPORTED)
+ target_link_libraries(PkgConfig::PCSCLITE INTERFACE winscard)
+ set(PCSCLITE_FOUND 1)
+elseif(MACOS)
+ qt_internal_find_apple_system_framework(FWPCSC PCSC)
+ add_library(PkgConfig::PCSCLITE INTERFACE IMPORTED)
+ target_link_libraries(PkgConfig::PCSCLITE INTERFACE ${FWPCSC})
+ set(PCSCLITE_FOUND 1)
+else()
+ find_package(PkgConfig QUIET)
+
+ pkg_check_modules(PCSCLITE libpcsclite IMPORTED_TARGET)
+endif()
+
+if(NOT TARGET PkgConfig::PCSCLITE)
+ set(PCSCLITE_FOUND 0)
+endif()