Update CMake files in order to be able to compile under Windows 64bits. (Thanks to Fkooman)
This commit is contained in:
parent
831dbd31a4
commit
a58ac6926d
5 changed files with 196 additions and 45 deletions
47
cmake_modules/FindLIBUSB.cmake
Normal file
47
cmake_modules/FindLIBUSB.cmake
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# This CMake script wants to use libusb functionality, therefore it looks
|
||||
# for libusb include files and libraries.
|
||||
#
|
||||
# Operating Systems Supported:
|
||||
# - Unix (requires pkg-config)
|
||||
# Tested with Ubuntu 9.04 and Fedora 11
|
||||
# - Windows (requires MSVC)
|
||||
# Tested with Windows XP
|
||||
#
|
||||
# This should work for both 32 bit and 64 bit systems.
|
||||
#
|
||||
# Author: F. Kooman <fkooman@tuxed.net>
|
||||
#
|
||||
|
||||
IF(MSVC)
|
||||
# Windows with Microsoft Visual C++
|
||||
FIND_PATH(LIBUSB_INCLUDE_DIRS usb.h "$ENV{ProgramFiles}/LibUSB-Win32/include")
|
||||
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64")
|
||||
# on x64 (win64)
|
||||
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/msvc_x64")
|
||||
ELSE(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64")
|
||||
# on x86 (win32)
|
||||
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/msvc")
|
||||
ENDIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64")
|
||||
ELSE(MSVC)
|
||||
# If not MS Visual Studio we use PkgConfig
|
||||
FIND_PACKAGE (PkgConfig)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(LIBUSB REQUIRED libusb)
|
||||
ELSE(PKG_CONFIG_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Could not find PkgConfig")
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
ENDIF(MSVC)
|
||||
|
||||
IF(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES)
|
||||
SET(LIBUSB_FOUND TRUE)
|
||||
ENDIF(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES)
|
||||
|
||||
IF(LIBUSB_FOUND)
|
||||
IF(NOT LIBUSB_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found LIBUSB: ${LIBUSB_LIBRARIES}")
|
||||
ENDIF (NOT LIBUSB_FIND_QUIETLY)
|
||||
ELSE(LIBUSB_FOUND)
|
||||
IF(LIBUSB_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find LIBUSB")
|
||||
ENDIF(LIBUSB_FIND_REQUIRED)
|
||||
ENDIF(LIBUSB_FOUND)
|
||||
41
cmake_modules/FindPCSC.cmake
Normal file
41
cmake_modules/FindPCSC.cmake
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# This CMake script wants to use PC/SC functionality, therefore it looks
|
||||
# for PC/SC include files and libraries.
|
||||
#
|
||||
# Operating Systems Supported:
|
||||
# - Unix (requires pkg-config)
|
||||
# Tested with Ubuntu 9.04 and Fedora 11
|
||||
# - Windows (requires MSVC)
|
||||
# Tested with Windows XP
|
||||
#
|
||||
# This should work for both 32 bit and 64 bit systems.
|
||||
#
|
||||
# Author: F. Kooman <fkooman@tuxed.net>
|
||||
#
|
||||
|
||||
IF(MSVC)
|
||||
# Windows with Microsoft Visual C++
|
||||
FIND_PATH(PCSC_INCLUDE_DIRS WinSCard.h "$ENV{INCLUDE}")
|
||||
FIND_LIBRARY(PCSC_LIBRARIES NAMES WinSCard PATHS "$ENV{LIB}")
|
||||
ELSE(MSVC)
|
||||
# If not MS Visual Studio we use PkgConfig
|
||||
FIND_PACKAGE (PkgConfig)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(PCSC REQUIRED libpcsclite)
|
||||
ELSE(PKG_CONFIG_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Could not find PkgConfig")
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
ENDIF(MSVC)
|
||||
|
||||
IF(PCSC_INCLUDE_DIRS AND PCSC_LIBRARIES)
|
||||
SET(PCSC_FOUND TRUE)
|
||||
ENDIF(PCSC_INCLUDE_DIRS AND PCSC_LIBRARIES)
|
||||
|
||||
IF(PCSC_FOUND)
|
||||
IF(NOT PCSC_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found PCSC: ${PCSC_LIBRARIES}")
|
||||
ENDIF(NOT PCSC_FIND_QUIETLY)
|
||||
ELSE(PCSC_FOUND)
|
||||
IF(PCSC_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find PCSC")
|
||||
ENDIF(PCSC_FIND_REQUIRED)
|
||||
ENDIF(PCSC_FOUND)
|
||||
Loading…
Add table
Add a link
Reference in a new issue