diff --git a/cmake/modules/LibnfcDrivers.cmake b/cmake/modules/LibnfcDrivers.cmake index 84a2bc9..8611844 100644 --- a/cmake/modules/LibnfcDrivers.cmake +++ b/cmake/modules/LibnfcDrivers.cmake @@ -19,11 +19,13 @@ ENDIF(LIBNFC_DRIVER_PN53X_USB) IF(LIBNFC_DRIVER_ARYGON) ADD_DEFINITIONS("-DDRIVER_ARYGON_ENABLED") SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/arygon") + SET(UART_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_ARYGON) IF(LIBNFC_DRIVER_PN532_UART) ADD_DEFINITIONS("-DDRIVER_PN532_UART_ENABLED") SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_uart") + SET(UART_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_PN532_UART) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/drivers) diff --git a/libnfc/CMakeLists.txt b/libnfc/CMakeLists.txt index f03f0ca..920e15e 100644 --- a/libnfc/CMakeLists.txt +++ b/libnfc/CMakeLists.txt @@ -13,10 +13,13 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/chips) # Library's buses IF(LIBUSB_FOUND) - SET(BUSES_SOURCES buses/uart buses/usbbus) -ELSE(LIBUSB_FOUND) - SET(BUSES_SOURCES buses/uart) + SET(BUSES_SOURCES buses/usbbus) ENDIF(LIBUSB_FOUND) + +IF(UART_REQUIRED) + LIST(APPEND BUSES_SOURCES buses/uart) +ENDIF(UART_REQUIRED) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses) IF(WIN32)