5db8be908b
- Move CMake modules from cmake_modules/ to cmake/modules/ - CMake now use cmake/config_windows.h.cmake to create config.h on Windows platform - contrib/windows.h header is automagically included by config.h - Put missing NFC_EXPORT macro on front of emulation API - nfc-mfclassic and nfc-mfcultralight examples are now compiled under Windows Many thanks to Glenn Ergeerts which provide the initial patch.
28 lines
1.2 KiB
CMake
28 lines
1.2 KiB
CMake
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
|
|
|
|
# XXX: Examples should not use private API!
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libnfc)
|
|
|
|
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
|
|
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS} ${PCSC_LIBRARY_DIRS})
|
|
|
|
ADD_LIBRARY(nfc-utils nfc-utils)
|
|
|
|
# Examples
|
|
FOREACH(source ${EXAMPLES-SOURCES})
|
|
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"))
|
|
TARGET_LINK_LIBRARIES(${source} nfc)
|
|
TARGET_LINK_LIBRARIES(${source} nfc-utils)
|
|
INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT examples)
|
|
ENDFOREACH(source)
|
|
|
|
IF(NOT WIN32)
|
|
# Manuals for the examples
|
|
FILE(GLOB manuals "${CMAKE_CURRENT_SOURCE_DIR}/*.1")
|
|
INSTALL(FILES ${manuals} DESTINATION ${SHARE_INSTALL_PREFIX}/man/man1 COMPONENT manuals)
|
|
ENDIF(NOT WIN32)
|