2009-11-20 12:27:07 +01:00
|
|
|
# Library's chips
|
|
|
|
SET(CHIPS_SOURCES chips/pn53x)
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/chips)
|
|
|
|
|
2009-11-04 13:03:49 +01:00
|
|
|
# Library's buses
|
|
|
|
SET(BUSES_SOURCES buses/uart)
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses)
|
|
|
|
|
|
|
|
# Library's drivers
|
|
|
|
SET(DRIVERS_SOURCES drivers/arygon drivers/pn532_uart)
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/drivers)
|
|
|
|
|
|
|
|
## find PCSC library and headers
|
|
|
|
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}")
|
2010-01-11 21:33:46 +01:00
|
|
|
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn531_usb" "drivers/pn533_usb" "drivers/pn53x_usb.c")
|
2009-11-04 13:03:49 +01:00
|
|
|
ENDIF(LIBNFC_USB)
|
|
|
|
|
2009-12-01 14:26:34 +01:00
|
|
|
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
|
|
|
|
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS} ${PCSC_LIBRARY_DIRS})
|
2009-11-04 11:42:53 +01:00
|
|
|
|
|
|
|
# Library
|
2009-11-20 12:27:07 +01:00
|
|
|
SET(LIBRARY_SOURCES nfc bitutils ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES})
|
2009-11-04 13:03:49 +01:00
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
ADD_LIBRARY(nfc SHARED ${LIBRARY_SOURCES})
|
2009-11-04 11:42:53 +01:00
|
|
|
TARGET_LINK_LIBRARIES(nfc ${LIBUSB_LIBRARIES} ${PCSC_LIBRARIES})
|
2009-12-01 15:23:00 +01:00
|
|
|
SET_TARGET_PROPERTIES(nfc PROPERTIES SOVERSION 0)
|
2009-11-04 11:42:53 +01:00
|
|
|
|
|
|
|
IF(MSVC)
|
|
|
|
# On Windows the shared (runtime) library should be either in the same
|
|
|
|
# directory as the excutables or in the path, we add it to same directory
|
|
|
|
INSTALL(TARGETS nfc RUNTIME DESTINATION bin COMPONENT libraries)
|
|
|
|
|
|
|
|
# At compile time we need the .LIB file, we place it in the lib directory
|
|
|
|
INSTALL(TARGETS nfc ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT headers)
|
|
|
|
ELSE(MSVC)
|
|
|
|
INSTALL(TARGETS nfc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
|
|
|
|
ENDIF(MSVC)
|
|
|
|
|