smartcard: fix PCSC detection/build on OS X

fixes #1683
This commit is contained in:
Bernhard Miklautz
2014-02-07 00:14:46 +01:00
parent 19ab10d819
commit 7815747d02
2 changed files with 23 additions and 1 deletions

View File

@@ -12,6 +12,14 @@ find_path(PCSC_INCLUDE_DIR pcsclite.h
find_library(PCSC_LIBRARY pcsclite
PATHS ${PCSC_LIBRARY_DIRS})
# Windows and Mac detection from http://www.cmake.org/Bug/print_bug_page.php?bug_id=11325
IF(NOT PCSC_FOUND)
# Will find PC/SC headers both on Mac and Windows
FIND_PATH(PCSC_INCLUDE_DIRS WinSCard.h)
# PCSC library is for Mac, WinSCard library is for Windows
FIND_LIBRARY(PCSC_LIBRARY NAMES PCSC WinSCard)
ENDIF(NOT PCSC_FOUND)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCSC DEFAULT_MSG PCSC_INCLUDE_DIR PCSC_LIBRARY)
mark_as_advanced(PCSC_INCLUDE_DIR PCSC_LIBRARY)