diff --git a/CMakeLists.txt b/CMakeLists.txt index 09d3eff..0cfaf3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") SET(LIBNFC_VERBOSE_OUTPUT OFF CACHE BOOL "Verbose output of communication with the NFC chip") SET(LIBNFC_LANG_C99 OFF CACHE BOOL "Use C99 language standard (GCC only)") -SET(LIBNFC_PCSC ON CACHE BOOL "Enable PC/SC support (PN532)") +SET(LIBNFC_PCSC ON CACHE BOOL "Enable PC/SC support (ACR122)") SET(LIBNFC_USB OFF CACHE BOOL "Enable direct USB communication support (PN531 and PN533)") SET(LIBNFC_DISABLE_SERIAL_AUTOPROBE OFF CACHE BOOL "Disable serial autoprobe") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a4ed7a8..a0d314a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,4 @@ SET(LIBRARY-SOURCES libnfc rs232 bitutils dev_arygon) -SET(EXAMPLES-SOURCES list mftool mfultool initiator target anticol emulate relay) # find PCSC library and headers IF(LIBNFC_PCSC) @@ -65,13 +64,4 @@ IF(MSVC) #INSTALL(FILES ${stdint} DESTINATION ${INCLUDE_INSTALL_DIR}/libnfc COMPONENT headers) ENDIF(MSVC) -# Examples -FOREACH(source ${EXAMPLES-SOURCES}) - ADD_EXECUTABLE(nfc-${source} ${source}.c) - TARGET_LINK_LIBRARIES(nfc-${source} nfc) - INSTALL(TARGETS nfc-${source} RUNTIME DESTINATION bin COMPONENT examples) -ENDFOREACH(source) - -# Manuals for the examples -FILE(GLOB manuals "${CMAKE_CURRENT_SOURCE_DIR}/*.1") -INSTALL(FILES ${manuals} DESTINATION ${SHARE_INSTALL_PREFIX}/man/man1 COMPONENT manuals) +ADD_SUBDIRECTORY(examples) diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt new file mode 100644 index 0000000..56cf9c1 --- /dev/null +++ b/src/examples/CMakeLists.txt @@ -0,0 +1,14 @@ +SET(EXAMPLES-SOURCES nfc-list nfc-mftool nfc-mfultool nfcip-initiator nfcip-target nfc-anticol nfc-emulate nfc-relay) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) + +# Examples +FOREACH(source ${EXAMPLES-SOURCES}) + ADD_EXECUTABLE(${source} ${source}.c) + TARGET_LINK_LIBRARIES(${source} nfc) + INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT examples) +ENDFOREACH(source) + +# Manuals for the examples +FILE(GLOB manuals "${CMAKE_CURRENT_SOURCE_DIR}/*.1") +INSTALL(FILES ${manuals} DESTINATION ${SHARE_INSTALL_PREFIX}/man/man1 COMPONENT manuals)