2011-03-31 15:38:49 +02:00
|
|
|
SET(EXAMPLES-SOURCES nfc-anticol nfc-dep-initiator nfc-dep-target nfc-emulate-forum-tag4 nfc-emulate-tag nfc-emulate-uid nfc-list nfc-poll nfc-relay nfc-relay-picc nfc-mfclassic nfc-mfultralight)
|
|
|
|
#TODO pn53x-diagnose pn53x-sam pn53x-tamashell
|
2009-10-06 12:01:18 +02:00
|
|
|
|
2010-04-07 16:37:19 +02:00
|
|
|
# XXX: Examples should not use private API!
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libnfc)
|
2009-10-06 12:01:18 +02:00
|
|
|
|
2009-12-01 14:26:34 +01:00
|
|
|
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
|
|
|
|
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS} ${PCSC_LIBRARY_DIRS})
|
|
|
|
|
2010-04-16 19:20:22 +02:00
|
|
|
ADD_LIBRARY(nfc-utils nfc-utils)
|
|
|
|
|
2009-10-06 12:01:18 +02:00
|
|
|
# Examples
|
|
|
|
FOREACH(source ${EXAMPLES-SOURCES})
|
2011-03-31 15:38:49 +02:00
|
|
|
IF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
|
|
|
|
ADD_EXECUTABLE(${source} ${source}.c mifare)
|
|
|
|
ELSE()
|
|
|
|
ADD_EXECUTABLE(${source} ${source}.c)
|
|
|
|
ENDIF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
|
2009-10-06 12:01:18 +02:00
|
|
|
TARGET_LINK_LIBRARIES(${source} nfc)
|
2010-04-16 19:20:22 +02:00
|
|
|
TARGET_LINK_LIBRARIES(${source} nfc-utils)
|
2009-10-06 12:01:18 +02:00
|
|
|
INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT examples)
|
|
|
|
ENDFOREACH(source)
|
|
|
|
|
2011-04-20 15:18:38 +02:00
|
|
|
#install required libraries
|
|
|
|
IF(WIN32)
|
|
|
|
INCLUDE(InstallRequiredSystemLibraries)
|
|
|
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/FixBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake @ONLY)
|
|
|
|
INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2010-11-17 09:29:41 +01:00
|
|
|
IF(NOT WIN32)
|
2010-03-23 11:00:48 +01:00
|
|
|
# Manuals for the examples
|
|
|
|
FILE(GLOB manuals "${CMAKE_CURRENT_SOURCE_DIR}/*.1")
|
|
|
|
INSTALL(FILES ${manuals} DESTINATION ${SHARE_INSTALL_PREFIX}/man/man1 COMPONENT manuals)
|
2010-11-17 09:29:41 +01:00
|
|
|
ENDIF(NOT WIN32)
|