Change to way to handle DRIVERS_SOURCES in CMake.
This commit is contained in:
parent
27ccf67503
commit
e45a0943e8
2 changed files with 17 additions and 18 deletions
|
@ -5,21 +5,32 @@ SET(LIBNFC_DRIVER_ARYGON ON CACHE BOOL "Enable ARYGON support (Use serial port)"
|
||||||
SET(LIBNFC_DRIVER_PN532_UART OFF CACHE BOOL "Enable PN533_USB support (Use serial port)")
|
SET(LIBNFC_DRIVER_PN532_UART OFF CACHE BOOL "Enable PN533_USB support (Use serial port)")
|
||||||
|
|
||||||
IF(LIBNFC_DRIVER_ACR122)
|
IF(LIBNFC_DRIVER_ACR122)
|
||||||
|
FIND_PACKAGE(PCSC REQUIRED)
|
||||||
ADD_DEFINITIONS("-DDRIVER_ACR122_ENABLED")
|
ADD_DEFINITIONS("-DDRIVER_ACR122_ENABLED")
|
||||||
|
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122")
|
||||||
ENDIF(LIBNFC_DRIVER_ACR122)
|
ENDIF(LIBNFC_DRIVER_ACR122)
|
||||||
|
|
||||||
IF(LIBNFC_DRIVER_PN531_USB)
|
IF(LIBNFC_DRIVER_PN531_USB)
|
||||||
|
FIND_PACKAGE(LIBUSB REQUIRED)
|
||||||
ADD_DEFINITIONS("-DDRIVER_PN531_USB_ENABLED")
|
ADD_DEFINITIONS("-DDRIVER_PN531_USB_ENABLED")
|
||||||
|
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn531_usb" "drivers/pn53x_usb.c")
|
||||||
ENDIF(LIBNFC_DRIVER_PN531_USB)
|
ENDIF(LIBNFC_DRIVER_PN531_USB)
|
||||||
|
|
||||||
IF(LIBNFC_DRIVER_PN533_USB)
|
IF(LIBNFC_DRIVER_PN533_USB)
|
||||||
|
FIND_PACKAGE(LIBUSB REQUIRED)
|
||||||
ADD_DEFINITIONS("-DDRIVER_PN533_USB_ENABLED")
|
ADD_DEFINITIONS("-DDRIVER_PN533_USB_ENABLED")
|
||||||
|
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn533_usb" "drivers/pn53x_usb.c")
|
||||||
ENDIF(LIBNFC_DRIVER_PN533_USB)
|
ENDIF(LIBNFC_DRIVER_PN533_USB)
|
||||||
|
|
||||||
IF(LIBNFC_DRIVER_ARYGON)
|
IF(LIBNFC_DRIVER_ARYGON)
|
||||||
ADD_DEFINITIONS("-DDRIVER_ARYGON_ENABLED")
|
ADD_DEFINITIONS("-DDRIVER_ARYGON_ENABLED")
|
||||||
|
SET(DRIVERS_SOURCES drivers/arygon)
|
||||||
ENDIF(LIBNFC_DRIVER_ARYGON)
|
ENDIF(LIBNFC_DRIVER_ARYGON)
|
||||||
|
|
||||||
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/pn532_uart)
|
||||||
ENDIF(LIBNFC_DRIVER_PN532_UART)
|
ENDIF(LIBNFC_DRIVER_PN532_UART)
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/drivers)
|
||||||
|
|
||||||
|
|
|
@ -7,24 +7,12 @@ SET(BUSES_SOURCES buses/uart)
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses)
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses)
|
||||||
|
|
||||||
# Library's drivers
|
# Library's drivers
|
||||||
SET(DRIVERS_SOURCES drivers/arygon drivers/pn532_uart)
|
SET(LIBNFC_SERIAL_AUTOPROBE_ENABLED OFF CACHE BOOL "Allow serial ports to be probed (can seriously disturb connected serial devices)")
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/drivers)
|
IF(LIBNFC_SERIAL_AUTOPROBE_ENABLED)
|
||||||
|
ADD_DEFINITIONS("-DSERIAL_AUTOPROBE_ENABLED")
|
||||||
|
ENDIF(LIBNFC_SERIAL_AUTOPROBE_ENABLED)
|
||||||
|
|
||||||
## find PCSC library and headers
|
INCLUDE(LibnfcDrivers)
|
||||||
IF(LIBNFC_PCSC)
|
|
||||||
FIND_PACKAGE(PCSC REQUIRED)
|
|
||||||
ADD_DEFINITIONS("-DHAVE_PCSC_LITE=1")
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PCSC_CFLAGS_OTHER}")
|
|
||||||
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122")
|
|
||||||
ENDIF(LIBNFC_PCSC)
|
|
||||||
|
|
||||||
## find libusb library and headers
|
|
||||||
IF(LIBNFC_USB)
|
|
||||||
FIND_PACKAGE(LIBUSB REQUIRED)
|
|
||||||
ADD_DEFINITIONS("-DHAVE_LIBUSB=1")
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS_OTHER}")
|
|
||||||
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn531_usb" "drivers/pn533_usb" "drivers/pn53x_usb.c")
|
|
||||||
ENDIF(LIBNFC_USB)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
|
||||||
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS} ${PCSC_LIBRARY_DIRS})
|
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS} ${PCSC_LIBRARY_DIRS})
|
||||||
|
|
Loading…
Reference in a new issue