Improve Windows platform support (Thanks to Glenn)

* Remove stdint for MSVC since MSVC is not supported anymore;
 * Fix libusb detection under Windows;
 * Fix PCSC detection (mingw-w64 now have PC/SC Winscard interface);
 * Ajust CMake files in order to make it compile (some examples have been disabled).
This commit is contained in:
Romuald Conty 2011-01-17 13:42:24 +00:00
parent f32013aba5
commit 58c5662f35
9 changed files with 16 additions and 745 deletions

View file

@ -27,7 +27,7 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
IF(NOT LIBUSB_FOUND)
IF(WIN32)
# Windows with Microsoft Visual C++
FIND_PATH(LIBUSB_INCLUDE_DIRS usb.h "$ENV{ProgramFiles}/LibUSB-Win32/include")
FIND_PATH(LIBUSB_INCLUDE_DIRS usb.h "$ENV{ProgramFiles}/LibUSB-Win32/include" NO_SYSTEM_ENVIRONMENT_PATH)
IF(MSVC)
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64")
# on x64 (win64)
@ -57,7 +57,7 @@ ENDIF(NOT LIBUSB_FOUND)
IF(LIBUSB_FOUND)
IF(NOT LIBUSB_FIND_QUIETLY)
MESSAGE(STATUS "Found LIBUSB: ${LIBUSB_LIBRARIES}")
MESSAGE(STATUS "Found LIBUSB: ${LIBUSB_LIBRARIES} ${LIBUSB_INCLUDE_DIRS}")
ENDIF (NOT LIBUSB_FIND_QUIETLY)
ELSE(LIBUSB_FOUND)
IF(LIBUSB_FIND_REQUIRED)

View file

@ -20,13 +20,7 @@ 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_LIBRARIES NAMES PCSC WinSCard)
IF(MINGW)
# MinGW32 with PCSC framework use Microsoft SDK's WinSCard.h
SET(PCSC_INCLUDE_DIRS)
SET(PCSC_INCLUDE_DIRS "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v7.0/Include")
ENDIF(MINGW)
FIND_LIBRARY(PCSC_LIBRARIES NAMES PCSC libwinscard)
ENDIF(NOT PCSC_FOUND)
INCLUDE(FindPackageHandleStandardArgs)