Add CMake configure option to not compile PC/SC support (defaults ON).

Sync variables in CMake file with current pkg-config file variables.
This commit is contained in:
Romuald Conty 2009-09-03 09:21:52 +00:00
parent 3e547300b0
commit d6868037c8
2 changed files with 25 additions and 12 deletions

View file

@ -4,19 +4,25 @@ SET(VERSION "1.2.2")
SET(LIBNFC_VERBOSE_OUTPUT OFF CACHE BOOL "Verbose output of communication with the NFC chip")
SET(LIBNFC_LANG_C99 OFF CACHE BOOL "Use C99 language standard (GCC only)")
SET(LIBNFC_PCSC ON CACHE BOOL "Enable PC/SC support")
# Set some pkg-config variables
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix ${CMAKE_INSTALL_PREFIX})
SET(PACKAGE "libnfc")
IF(DEFINED CMAKE_INSTALL_LIBDIR)
SET(PKG_LIBDIR ${CMAKE_INSTALL_LIBDIR})
SET(libdir ${CMAKE_INSTALL_LIBDIR})
ELSE(DEFINED CMAKE_INSTALL_LIBDIR)
SET(CMAKE_INSTALL_LIBDIR lib)
SET(PKG_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
SET(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
ENDIF(DEFINED CMAKE_INSTALL_LIBDIR)
IF(DEFINED INCLUDE_INSTALL_DIR)
SET(PKG_INCLUDE_DIR ${INCLUDE_INSTALL_DIR})
SET(includedir ${INCLUDE_INSTALL_DIR})
ELSE(DEFINED INCLUDE_INSTALL_DIR)
SET(INCLUDE_INSTALL_DIR include)
SET(PKG_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR})
SET(includedir ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR})
ENDIF(DEFINED INCLUDE_INSTALL_DIR)
IF(NOT DEFINED SHARE_INSTALL_PREFIX)

View file

@ -1,7 +1,10 @@
SET(LIBRARY-SOURCES libnfc dev_pn531 dev_pn533 dev_acr122 rs232 bitutils dev_arygon)
SET(LIBRARY-SOURCES libnfc dev_pn531 dev_pn533 rs232 bitutils dev_arygon)
SET(TOOLS-SOURCES list mftool mfultool)
IF(LIBNFC_PCSC)
ADD_DEFINITIONS("-DHAVE_PCSC_LITE=1")
SET(LIBRARY-SOURCES ${LIBRARY-SOURCES} "dev_acr122")
ENDIF(LIBNFC_PCSC)
IF(LIBNFC_VERBOSE_OUTPUT)
ADD_DEFINITIONS("-DDEBUG")
@ -24,15 +27,19 @@ IF(MSVC)
SET(LIBUSB_INCLUDE_DIRS $ENV{ProgramFiles}/LibUSB-Win32/include)
SET(LIBUSB_LIBRARIES $ENV{ProgramFiles}/LibUSB-Win32/lib/msvc/libusb.lib)
IF(LIBNFC_PCSC)
# This is included with Visual Studio Express 2008, we should really use
# something that finds this library, whatever the MSVC version
SET(LIBPCSCLITE_LIBRARIES "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v6.0A/Lib/WinSCard.Lib")
# On MSVC we don't need the winscard.h header in the include path because
# it already is there...
ENDIF(LIBNFC_PCSC)
ELSE(MSVC)
# On Unix we just use pkg-config
PKG_CHECK_MODULES(LIBUSB REQUIRED libusb)
IF(LIBNFC_PCSC)
PKG_CHECK_MODULES(LIBPCSCLITE REQUIRED libpcsclite)
ENDIF(LIBNFC_PCSC)
ENDIF(MSVC)
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${LIBPCSCLITE_INCLUDE_DIRS})