From 87182b5a65c628a308a5c5e30ea1fec4542faa4a Mon Sep 17 00:00:00 2001 From: Alex Lian Date: Sun, 27 Jan 2013 23:24:03 -0500 Subject: [PATCH] Windows: Fix nfc-scan-device to compile by linking in contrib/nfc_win32.c Re-factored the executable call with a list that is created, so that its easier to modify per tool. --- utils/CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index ae622ff..57f4f03 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -15,13 +15,23 @@ TARGET_LINK_LIBRARIES(nfcutils nfc) # Examples FOREACH(source ${UTILS-SOURCES}) + SET (TARGETS ${source}.c) + IF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic")) - ADD_EXECUTABLE(${source} ${source}.c mifare) - ELSE() - ADD_EXECUTABLE(${source} ${source}.c) + LIST(APPEND TARGETS mifare) ENDIF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic")) + + IF(${source} MATCHES "nfc-scan-device") + LIST(APPEND TARGETS ../contrib/win32/nfc_win32) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32) + ENDIF(${source} MATCHES "nfc-scan-device") + + ADD_EXECUTABLE(${source} ${TARGETS}) + TARGET_LINK_LIBRARIES(${source} nfc) TARGET_LINK_LIBRARIES(${source} nfcutils) + + INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT utils) ENDFOREACH(source)