Fixes CMake build (Fixes Issue 211).

Thanks to Alex Lian
This commit is contained in:
Romuald Conty 2012-10-30 22:11:19 +01:00
parent f1b55b5390
commit d6c97cb974
3 changed files with 11 additions and 13 deletions

View file

@ -1,13 +1,14 @@
SET(LIBNFC_DRIVER_ACR122 ON CACHE BOOL "Enable ACR122 support (Depends on PC/SC)")
SET(LIBNFC_DRIVER_ACR122_PCSC ON CACHE BOOL "Enable ACR122 support (Depends on PC/SC)")
#SET(LIBNFC_DRIVER_ACR122_USB ON CACHE BOOL "Enable ACR122 support (Direct USB connection)")
SET(LIBNFC_DRIVER_PN53X_USB ON CACHE BOOL "Enable PN531 and PN531 USB support (Depends on libusb)")
SET(LIBNFC_DRIVER_ARYGON ON CACHE BOOL "Enable ARYGON support (Use serial port)")
SET(LIBNFC_DRIVER_PN532_UART OFF CACHE BOOL "Enable PN532 UART support (Use serial port)")
IF(LIBNFC_DRIVER_ACR122)
IF(LIBNFC_DRIVER_ACR122_PCSC)
FIND_PACKAGE(PCSC REQUIRED)
ADD_DEFINITIONS("-DDRIVER_ACR122_ENABLED")
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122")
ENDIF(LIBNFC_DRIVER_ACR122)
ADD_DEFINITIONS("-DDRIVER_ACR122_PCSC_ENABLED")
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122_pcsc")
ENDIF(LIBNFC_DRIVER_ACR122_PCSC)
IF(LIBNFC_DRIVER_PN53X_USB)
FIND_PACKAGE(LIBUSB REQUIRED)

View file

@ -6,12 +6,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/chips)
SET(BUSES_SOURCES buses/uart)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses)
# Library's drivers
SET(LIBNFC_SERIAL_AUTOPROBE_ENABLED OFF CACHE BOOL "Allow serial ports to be probed (can seriously disturb connected serial devices)")
IF(LIBNFC_SERIAL_AUTOPROBE_ENABLED)
ADD_DEFINITIONS("-DSERIAL_AUTOPROBE_ENABLED")
ENDIF(LIBNFC_SERIAL_AUTOPROBE_ENABLED)
INCLUDE(LibnfcDrivers)
IF(PCSC_FOUND)
@ -25,8 +19,11 @@ IF(LIBUSB_FOUND)
ENDIF(LIBUSB_FOUND)
# Library
SET(LIBRARY_SOURCES nfc nfc-device nfc-emulation nfc-internal iso14443-subr mirror-subr ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES})
SET(LIBRARY_SOURCES nfc nfc-device nfc-emulation nfc-internal iso14443-subr mirror-subr target-subr ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
IF(LIBNFC_DEBUG_OUTPUT)
LIST(APPEND LIBRARY_SOURCES log-printf)
ENDIF(LIBNFC_DEBUG_OUTPUT)
ADD_LIBRARY(nfc SHARED ${LIBRARY_SOURCES})
IF(PCSC_FOUND)

View file

@ -3,9 +3,9 @@ SET(UTILS-SOURCES
nfc-list
nfc-mfclassic
nfc-mfultralight
nfc-probe
nfc-read-forum-tag3
nfc-relay-picc
nfc-scan-device
)
ADD_LIBRARY(nfcutils STATIC