Add PN532 SPI driver to CMake

This commit is contained in:
Philippe Teuwen 2013-03-27 23:25:43 +01:00
parent dcc527df7b
commit 7c2f8b4cb0
2 changed files with 21 additions and 0 deletions

View file

@ -2,6 +2,11 @@ SET(LIBNFC_DRIVER_ACR122_PCSC OFF CACHE BOOL "Enable ACR122 support (Depends on
SET(LIBNFC_DRIVER_ACR122_USB ON CACHE BOOL "Enable ACR122 support (Direct USB connection)") SET(LIBNFC_DRIVER_ACR122_USB ON CACHE BOOL "Enable ACR122 support (Direct USB connection)")
SET(LIBNFC_DRIVER_ACR122S ON CACHE BOOL "Enable ACR122S support (Use serial port)") SET(LIBNFC_DRIVER_ACR122S ON CACHE BOOL "Enable ACR122S support (Use serial port)")
SET(LIBNFC_DRIVER_ARYGON ON CACHE BOOL "Enable ARYGON support (Use serial port)") SET(LIBNFC_DRIVER_ARYGON ON CACHE BOOL "Enable ARYGON support (Use serial port)")
IF(WIN32)
SET(LIBNFC_DRIVER_PN532_SPI OFF CACHE BOOL "Enable PN532 SPI support (Use SPI bus)")
ELSE(WIN32)
SET(LIBNFC_DRIVER_PN532_SPI ON CACHE BOOL "Enable PN532 SPI support (Use SPI bus)")
ENDIF(WIN32)
SET(LIBNFC_DRIVER_PN532_UART ON CACHE BOOL "Enable PN532 UART support (Use serial port)") SET(LIBNFC_DRIVER_PN532_UART ON CACHE BOOL "Enable PN532 UART support (Use serial port)")
SET(LIBNFC_DRIVER_PN53X_USB ON CACHE BOOL "Enable PN531 and PN531 USB support (Depends on libusb)") SET(LIBNFC_DRIVER_PN53X_USB ON CACHE BOOL "Enable PN531 and PN531 USB support (Depends on libusb)")
@ -29,6 +34,12 @@ IF(LIBNFC_DRIVER_ARYGON)
SET(UART_REQUIRED TRUE) SET(UART_REQUIRED TRUE)
ENDIF(LIBNFC_DRIVER_ARYGON) ENDIF(LIBNFC_DRIVER_ARYGON)
IF(LIBNFC_DRIVER_PN532_SPI)
ADD_DEFINITIONS("-DDRIVER_PN532_SPI_ENABLED")
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_spi")
SET(SPI_REQUIRED TRUE)
ENDIF(LIBNFC_DRIVER_PN532_SPI)
IF(LIBNFC_DRIVER_PN532_UART) IF(LIBNFC_DRIVER_PN532_UART)
ADD_DEFINITIONS("-DDRIVER_PN532_UART_ENABLED") ADD_DEFINITIONS("-DDRIVER_PN532_UART_ENABLED")
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_uart") SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_uart")

View file

@ -25,6 +25,16 @@ IF(UART_REQUIRED)
ENDIF(WIN32) ENDIF(WIN32)
ENDIF(UART_REQUIRED) ENDIF(UART_REQUIRED)
IF(SPI_REQUIRED)
IF(WIN32)
# Windows is not supported at the moment
#LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/spi)
MESSAGE( FATAL_ERROR "SPI not (yet) supported under Windows!" )
ELSE(WIN32)
LIST(APPEND BUSES_SOURCES buses/spi)
ENDIF(WIN32)
ENDIF(SPI_REQUIRED)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses)
IF(WIN32) IF(WIN32)