diff --git a/cmake/modules/LibnfcDrivers.cmake b/cmake/modules/LibnfcDrivers.cmake index 267d002..a186739 100644 --- a/cmake/modules/LibnfcDrivers.cmake +++ b/cmake/modules/LibnfcDrivers.cmake @@ -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_ACR122S ON CACHE BOOL "Enable ACR122S 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_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) 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) ADD_DEFINITIONS("-DDRIVER_PN532_UART_ENABLED") SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_uart") diff --git a/libnfc/CMakeLists.txt b/libnfc/CMakeLists.txt index caae6df..21ced53 100644 --- a/libnfc/CMakeLists.txt +++ b/libnfc/CMakeLists.txt @@ -25,6 +25,16 @@ IF(UART_REQUIRED) ENDIF(WIN32) 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) IF(WIN32)