From d6c97cb9743c6f98d40d6a143e1b8a04d085be5a Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Tue, 30 Oct 2012 22:11:19 +0100 Subject: [PATCH] Fixes CMake build (Fixes Issue 211). Thanks to Alex Lian --- cmake/modules/LibnfcDrivers.cmake | 11 ++++++----- libnfc/CMakeLists.txt | 11 ++++------- utils/CMakeLists.txt | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/cmake/modules/LibnfcDrivers.cmake b/cmake/modules/LibnfcDrivers.cmake index f2cd200..84a2bc9 100644 --- a/cmake/modules/LibnfcDrivers.cmake +++ b/cmake/modules/LibnfcDrivers.cmake @@ -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) diff --git a/libnfc/CMakeLists.txt b/libnfc/CMakeLists.txt index 7f636f1..e8d2840 100644 --- a/libnfc/CMakeLists.txt +++ b/libnfc/CMakeLists.txt @@ -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) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index e6a8260..491fdfc 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -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